<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>My Project: D:/study/VulkanSDK/1.1.84/Demos/cube.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">My Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">D:/study/VulkanSDK/1.1.84/Demos/cube.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br />
<code>#include &lt;stdarg.h&gt;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &lt;stdbool.h&gt;</code><br />
<code>#include &lt;assert.h&gt;</code><br />
<code>#include &lt;signal.h&gt;</code><br />
<code>#include &lt;vulkan/vulkan.h&gt;</code><br />
<code>#include &lt;vulkan/vk_sdk_platform.h&gt;</code><br />
<code>#include &quot;linmath.h&quot;</code><br />
<code>#include &quot;object_type_string_helper.h&quot;</code><br />
<code>#include &quot;gettime.h&quot;</code><br />
<code>#include &quot;inttypes.h&quot;</code><br />
<code>#include &quot;lunarg.ppm.h&quot;</code><br />
<code>#include &quot;cube.vert.inc&quot;</code><br />
<code>#include &quot;cube.frag.inc&quot;</code><br />
<code>#include &lt;shellapi.h&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for cube.c:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c__incl.png" border="0" usemap="#_d_1_2study_2_vulkan_s_d_k_21_81_884_2_demos_2cube_8c" alt=""/></div>
<map name="_d_1_2study_2_vulkan_s_d_k_21_81_884_2_demos_2cube_8c" id="_d_1_2study_2_vulkan_s_d_k_21_81_884_2_demos_2cube_8c">
</map>
</div>
</div>
<p><a href="cube_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtexture__object.html">texture_object</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structvktexcube__vs__uniform.html">vktexcube_vs_uniform</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_swapchain_image_resources.html">SwapchainImageResources</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdemo.html">demo</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a369266c24eacffb87046522897a570d5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a369266c24eacffb87046522897a570d5">_GNU_SOURCE</a></td></tr>
<tr class="separator:a369266c24eacffb87046522897a570d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a368e7704f92e34c8ea0a5c263a95a1b1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a368e7704f92e34c8ea0a5c263a95a1b1">MILLION</a>&#160;&#160;&#160;1000000L</td></tr>
<tr class="separator:a368e7704f92e34c8ea0a5c263a95a1b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31f99d9c502b52b5f36dc7e2028c2e80"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a31f99d9c502b52b5f36dc7e2028c2e80">BILLION</a>&#160;&#160;&#160;1000000000L</td></tr>
<tr class="separator:a31f99d9c502b52b5f36dc7e2028c2e80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a889c754b96e13c9a94c431b8c10b7153"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a889c754b96e13c9a94c431b8c10b7153">DEMO_TEXTURE_COUNT</a>&#160;&#160;&#160;1</td></tr>
<tr class="separator:a889c754b96e13c9a94c431b8c10b7153"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5541e08a357bb88cd008693b6ffc6db"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ab5541e08a357bb88cd008693b6ffc6db">APP_SHORT_NAME</a>&#160;&#160;&#160;&quot;cube&quot;</td></tr>
<tr class="separator:ab5541e08a357bb88cd008693b6ffc6db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ddc1be37ecfdff9eaaaa045820a96ad"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a7ddc1be37ecfdff9eaaaa045820a96ad">APP_LONG_NAME</a>&#160;&#160;&#160;&quot;The Vulkan Cube Demo Program&quot;</td></tr>
<tr class="separator:a7ddc1be37ecfdff9eaaaa045820a96ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44a58ed35161ff13de8fbf41f913a729"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a44a58ed35161ff13de8fbf41f913a729">FRAME_LAG</a>&#160;&#160;&#160;2</td></tr>
<tr class="separator:a44a58ed35161ff13de8fbf41f913a729"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25f003de16c08a4888b69f619d70f427"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a25f003de16c08a4888b69f619d70f427">ARRAY_SIZE</a>(a)&#160;&#160;&#160;(sizeof(a) / sizeof(a[0]))</td></tr>
<tr class="separator:a25f003de16c08a4888b69f619d70f427"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab33dabc77056cb02bf8609c97d49716b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></td></tr>
<tr class="separator:ab33dabc77056cb02bf8609c97d49716b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:addf5ec070e9499d36b7f2009ce736076"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#addf5ec070e9499d36b7f2009ce736076">UNUSED</a></td></tr>
<tr class="separator:addf5ec070e9499d36b7f2009ce736076"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28fe14fddb8a99da1b8a644308d1a901"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(err_msg,  err_class)</td></tr>
<tr class="separator:a28fe14fddb8a99da1b8a644308d1a901"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe0326a2a1a9e72834ca67caab932c44"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#afe0326a2a1a9e72834ca67caab932c44">GET_INSTANCE_PROC_ADDR</a>(inst,  entrypoint)                                                                                                                        </td></tr>
<tr class="separator:afe0326a2a1a9e72834ca67caab932c44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5c664496b8f5564aac41b936cb8bbf8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ab5c664496b8f5564aac41b936cb8bbf8">GET_DEVICE_PROC_ADDR</a>(dev,  entrypoint)                                                                                                                                    </td></tr>
<tr class="separator:ab5c664496b8f5564aac41b936cb8bbf8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17ade23ed4742947e6c374209ca22fcd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a17ade23ed4742947e6c374209ca22fcd">APP_NAME_STR_LEN</a>&#160;&#160;&#160;80</td></tr>
<tr class="separator:a17ade23ed4742947e6c374209ca22fcd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a1714a35ca475fd30144cd4090d94d286"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a1714a35ca475fd30144cd4090d94d286">DbgMsg</a> (char *fmt,...)</td></tr>
<tr class="separator:a1714a35ca475fd30144cd4090d94d286"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3fbeb810082ceb57b4993b4c49de735b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a3fbeb810082ceb57b4993b4c49de735b">dumpMatrix</a> (const char *note, mat4x4 MVP)</td></tr>
<tr class="separator:a3fbeb810082ceb57b4993b4c49de735b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a9fa5a1ba7fafecaaadd21f8965fc06"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a2a9fa5a1ba7fafecaaadd21f8965fc06">dumpVec4</a> (const char *note, vec4 vector)</td></tr>
<tr class="separator:a2a9fa5a1ba7fafecaaadd21f8965fc06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47431f229fafc6047bb34487ee34151a"><td class="memItemLeft" align="right" valign="top">VKAPI_ATTR VkBool32 VKAPI_CALL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a47431f229fafc6047bb34487ee34151a">debug_messenger_callback</a> (VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData, void *pUserData)</td></tr>
<tr class="separator:a47431f229fafc6047bb34487ee34151a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab9ca7a0a208ec589229116f2de6ee77c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ab9ca7a0a208ec589229116f2de6ee77c">ActualTimeLate</a> (uint64_t desired, uint64_t actual, uint64_t rdur)</td></tr>
<tr class="separator:ab9ca7a0a208ec589229116f2de6ee77c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef0d76102bd69a61b3bc49beecae77ca"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca">CanPresentEarlier</a> (uint64_t earliest, uint64_t actual, uint64_t margin, uint64_t rdur)</td></tr>
<tr class="separator:aef0d76102bd69a61b3bc49beecae77ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac51a47d75843a542182cb6c2e997c67a"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a">demo_resize</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:ac51a47d75843a542182cb6c2e997c67a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff6bdb11d121e68bf2e3eecc2945ca3b"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b">memory_type_from_properties</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>, uint32_t typeBits, VkFlags requirements_mask, uint32_t *typeIndex)</td></tr>
<tr class="separator:aff6bdb11d121e68bf2e3eecc2945ca3b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a35f4639d32b3ac59dd725668a363ba"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a7a35f4639d32b3ac59dd725668a363ba">demo_flush_init_cmd</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:a7a35f4639d32b3ac59dd725668a363ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba0ddac08f75117254d652598aeb72f8"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8">demo_set_image_layout</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>, VkImage image, VkImageAspectFlags aspectMask, VkImageLayout old_image_layout, VkImageLayout new_image_layout, VkAccessFlagBits srcAccessMask, VkPipelineStageFlags src_stages, VkPipelineStageFlags dest_stages)</td></tr>
<tr class="separator:aba0ddac08f75117254d652598aeb72f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa9f275ddb85f8473f44c01a00ccfba63"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#aa9f275ddb85f8473f44c01a00ccfba63">demo_draw_build_cmd</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>, VkCommandBuffer cmd_buf)</td></tr>
<tr class="separator:aa9f275ddb85f8473f44c01a00ccfba63"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad1571a7e9407fa30327f858d07ea6702"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ad1571a7e9407fa30327f858d07ea6702">demo_build_image_ownership_cmd</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>, int i)</td></tr>
<tr class="separator:ad1571a7e9407fa30327f858d07ea6702"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2967b050fc63b30dc0cf382fbcf8f3c6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a2967b050fc63b30dc0cf382fbcf8f3c6">demo_update_data_buffer</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:a2967b050fc63b30dc0cf382fbcf8f3c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a004704ce51b4b63b3d59eef1d5ea2cee"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee">DemoUpdateTargetIPD</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:a004704ce51b4b63b3d59eef1d5ea2cee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68587107d1c17fe6680e438488b9a616"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616">demo_draw</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:a68587107d1c17fe6680e438488b9a616"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c4cc92dc1a3456d6cca76e3187f2010"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a0c4cc92dc1a3456d6cca76e3187f2010">demo_prepare_buffers</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:a0c4cc92dc1a3456d6cca76e3187f2010"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3569c83afeb4ecc4d8d797af29ce89ed"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a3569c83afeb4ecc4d8d797af29ce89ed">demo_prepare_depth</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:a3569c83afeb4ecc4d8d797af29ce89ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add4fd1e03edd51503c9c554e77a042fa"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#add4fd1e03edd51503c9c554e77a042fa">loadTexture</a> (const char *filename, uint8_t *rgba_data, VkSubresourceLayout *layout, int32_t *width, int32_t *height)</td></tr>
<tr class="separator:add4fd1e03edd51503c9c554e77a042fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a947291086c104a6dd03b8f6a2fc28731"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731">demo_prepare_texture_image</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>, const char *filename, struct <a class="el" href="structtexture__object.html">texture_object</a> *tex_obj, VkImageTiling tiling, VkImageUsageFlags usage, VkFlags required_props)</td></tr>
<tr class="separator:a947291086c104a6dd03b8f6a2fc28731"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10612fc5c33836b531554ee572b389f2"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a10612fc5c33836b531554ee572b389f2">demo_destroy_texture_image</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>, struct <a class="el" href="structtexture__object.html">texture_object</a> *tex_objs)</td></tr>
<tr class="separator:a10612fc5c33836b531554ee572b389f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0316bd7d613330a9963098b02a6396d7"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7">demo_prepare_textures</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:a0316bd7d613330a9963098b02a6396d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21da8dc23d75bc75b5dbe7dd01130739"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a21da8dc23d75bc75b5dbe7dd01130739">demo_prepare_cube_data_buffers</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:a21da8dc23d75bc75b5dbe7dd01130739"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a36308c10e305d94d63e96fc82be78950"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a36308c10e305d94d63e96fc82be78950">demo_prepare_descriptor_layout</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:a36308c10e305d94d63e96fc82be78950"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ac6098487e1fc2305847f666891cdec"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a4ac6098487e1fc2305847f666891cdec">demo_prepare_render_pass</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:a4ac6098487e1fc2305847f666891cdec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d15bfd7acf51a14826bbfe1d52da09c"><td class="memItemLeft" align="right" valign="top">static VkShaderModule&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c">demo_prepare_shader_module</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>, const uint32_t *code, size_t size)</td></tr>
<tr class="separator:a9d15bfd7acf51a14826bbfe1d52da09c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1d134177a8964ce85593b229fc7f688"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ab1d134177a8964ce85593b229fc7f688">demo_prepare_vs</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:ab1d134177a8964ce85593b229fc7f688"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab89d9436b88fd3dea5de8cb03de51e94"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ab89d9436b88fd3dea5de8cb03de51e94">demo_prepare_fs</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:ab89d9436b88fd3dea5de8cb03de51e94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa80cd8877b6b5d20217c451b207ca9d9"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#aa80cd8877b6b5d20217c451b207ca9d9">demo_prepare_pipeline</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:aa80cd8877b6b5d20217c451b207ca9d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ee7f5efc65c5972db015c6be8cda380"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a4ee7f5efc65c5972db015c6be8cda380">demo_prepare_descriptor_pool</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:a4ee7f5efc65c5972db015c6be8cda380"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac1957f225fabd1755a0064169fa5f6ba"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ac1957f225fabd1755a0064169fa5f6ba">demo_prepare_descriptor_set</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:ac1957f225fabd1755a0064169fa5f6ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a72610dc44a370494307b568ef3abd6"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a3a72610dc44a370494307b568ef3abd6">demo_prepare_framebuffers</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:a3a72610dc44a370494307b568ef3abd6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0fcfc933d495ab4fcf98493677e3d8da"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da">demo_prepare</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:a0fcfc933d495ab4fcf98493677e3d8da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae1040d749c8bf35f9b48f04879e65928"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ae1040d749c8bf35f9b48f04879e65928">demo_cleanup</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:ae1040d749c8bf35f9b48f04879e65928"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8fb1a4c54cb4307dda563a41fb31459b"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b">demo_run</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:a8fb1a4c54cb4307dda563a41fb31459b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae749e989b362e19783c7af4a2bf46c95"><td class="memItemLeft" align="right" valign="top">LRESULT CALLBACK&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95">WndProc</a> (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)</td></tr>
<tr class="separator:ae749e989b362e19783c7af4a2bf46c95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3553c2367998ea3c060aa8f3d64ed155"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155">demo_create_window</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:a3553c2367998ea3c060aa8f3d64ed155"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abcfbf263b3a2885f094ece366b4c2a5b"><td class="memItemLeft" align="right" valign="top">static VkBool32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#abcfbf263b3a2885f094ece366b4c2a5b">demo_check_layers</a> (uint32_t check_count, char **check_names, uint32_t layer_count, VkLayerProperties *layers)</td></tr>
<tr class="separator:abcfbf263b3a2885f094ece366b4c2a5b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abdcd6d1f2fdbb957fd5c0337d86a286c"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#abdcd6d1f2fdbb957fd5c0337d86a286c">demo_init_vk</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:abdcd6d1f2fdbb957fd5c0337d86a286c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac570d41514a55546127adf73c8faef66"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ac570d41514a55546127adf73c8faef66">demo_create_device</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:ac570d41514a55546127adf73c8faef66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab8af4815cac383b0436928fe474b98b3"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ab8af4815cac383b0436928fe474b98b3">demo_init_vk_swapchain</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:ab8af4815cac383b0436928fe474b98b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad89af5ea893ea45fdcd5478c0eb8edde"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ad89af5ea893ea45fdcd5478c0eb8edde">demo_init_connection</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>)</td></tr>
<tr class="separator:ad89af5ea893ea45fdcd5478c0eb8edde"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9614fd51f6e418355a34964db328d781"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a9614fd51f6e418355a34964db328d781">demo_init</a> (struct <a class="el" href="structdemo.html">demo</a> *<a class="el" href="structdemo.html">demo</a>, int argc, char **argv)</td></tr>
<tr class="separator:a9614fd51f6e418355a34964db328d781"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaeec9c5b7aa4be5544a74d2030e12a3a"><td class="memItemLeft" align="right" valign="top">int WINAPI&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a">WinMain</a> (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCmdLine, int nCmdShow)</td></tr>
<tr class="separator:aaeec9c5b7aa4be5544a74d2030e12a3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:ae47449d2c6ee5d67200b1d7e8ecec805"><td class="memItemLeft" align="right" valign="top">static PFN_vkGetDeviceProcAddr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ae47449d2c6ee5d67200b1d7e8ecec805">g_gdpa</a> = NULL</td></tr>
<tr class="separator:ae47449d2c6ee5d67200b1d7e8ecec805"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a302091c8be81415de8beb0d5b5e18529"><td class="memItemLeft" align="right" valign="top">static char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a302091c8be81415de8beb0d5b5e18529">tex_files</a> [] = {&quot;lunarg.ppm&quot;}</td></tr>
<tr class="separator:a302091c8be81415de8beb0d5b5e18529"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2a7e938c1d845c6a71f43750db0fd07"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#aa2a7e938c1d845c6a71f43750db0fd07">validation_error</a> = 0</td></tr>
<tr class="separator:aa2a7e938c1d845c6a71f43750db0fd07"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adee35d5feec2cc176806a5fa7f468648"><td class="memItemLeft" align="right" valign="top">static const float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#adee35d5feec2cc176806a5fa7f468648">g_vertex_buffer_data</a> []</td></tr>
<tr class="separator:adee35d5feec2cc176806a5fa7f468648"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac130934c0214edabeb9870bcd94eca8c"><td class="memItemLeft" align="right" valign="top">static const float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#ac130934c0214edabeb9870bcd94eca8c">g_uv_buffer_data</a> []</td></tr>
<tr class="separator:ac130934c0214edabeb9870bcd94eca8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11282d06da34a669ccca5b1a9336c225"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structdemo.html">demo</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="cube_8c.html#a11282d06da34a669ccca5b1a9336c225">demo</a></td></tr>
<tr class="separator:a11282d06da34a669ccca5b1a9336c225"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a369266c24eacffb87046522897a570d5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define _GNU_SOURCE</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00028">28</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

</div>
</div>
<a class="anchor" id="a7ddc1be37ecfdff9eaaaa045820a96ad"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define APP_LONG_NAME&#160;&#160;&#160;&quot;The Vulkan Cube Demo Program&quot;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00068">68</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

</div>
</div>
<a class="anchor" id="a17ade23ed4742947e6c374209ca22fcd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define APP_NAME_STR_LEN&#160;&#160;&#160;80</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00307">307</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l03702">WinMain()</a>.</p>

</div>
</div>
<a class="anchor" id="ab5541e08a357bb88cd008693b6ffc6db"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define APP_SHORT_NAME&#160;&#160;&#160;&quot;cube&quot;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00067">67</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l00453">debug_messenger_callback()</a>, <a class="el" href="cube_8c_source.html#l02387">demo_create_window()</a>, <a class="el" href="cube_8c_source.html#l03608">demo_init()</a>, <a class="el" href="cube_8c_source.html#l02849">demo_init_vk()</a>, and <a class="el" href="cube_8c_source.html#l03702">WinMain()</a>.</p>

</div>
</div>
<a class="anchor" id="a25f003de16c08a4888b69f619d70f427"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ARRAY_SIZE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a</td><td>)</td>
          <td>&#160;&#160;&#160;(sizeof(a) / sizeof(a[0]))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00073">73</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02849">demo_init_vk()</a>, <a class="el" href="cube_8c_source.html#l01171">demo_prepare_buffers()</a>, and <a class="el" href="cube_8c_source.html#l01887">demo_prepare_pipeline()</a>.</p>

</div>
</div>
<a class="anchor" id="a31f99d9c502b52b5f36dc7e2028c2e80"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BILLION&#160;&#160;&#160;1000000000L</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00064">64</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l00887">DemoUpdateTargetIPD()</a>.</p>

</div>
</div>
<a class="anchor" id="a889c754b96e13c9a94c431b8c10b7153"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DEMO_TEXTURE_COUNT&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00066">66</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02197">demo_cleanup()</a>, <a class="el" href="cube_8c_source.html#l01743">demo_prepare_descriptor_layout()</a>, <a class="el" href="cube_8c_source.html#l02004">demo_prepare_descriptor_pool()</a>, <a class="el" href="cube_8c_source.html#l02030">demo_prepare_descriptor_set()</a>, <a class="el" href="cube_8c_source.html#l01574">demo_prepare_textures()</a>, and <a class="el" href="cube_8c_source.html#l02283">demo_resize()</a>.</p>

</div>
</div>
<a class="anchor" id="a28fe14fddb8a99da1b8a644308d1a901"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ERR_EXIT</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">err_msg, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">err_class&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> {                             \</div><div class="line">        printf(<span class="stringliteral">&quot;%s\n&quot;</span>, err_msg);     \</div><div class="line">        fflush(stdout);              \</div><div class="line">        exit(1);                     \</div><div class="line">    } <span class="keywordflow">while</span> (0)</div></div><!-- fragment -->
<p>Definition at line <a class="el" href="cube_8c_source.html#l00123">123</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l03608">demo_init()</a>, <a class="el" href="cube_8c_source.html#l02849">demo_init_vk()</a>, <a class="el" href="cube_8c_source.html#l03278">demo_init_vk_swapchain()</a>, <a class="el" href="cube_8c_source.html#l01171">demo_prepare_buffers()</a>, and <a class="el" href="cube_8c_source.html#l01491">demo_prepare_texture_image()</a>.</p>

</div>
</div>
<a class="anchor" id="a44a58ed35161ff13de8fbf41f913a729"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define FRAME_LAG&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00071">71</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02197">demo_cleanup()</a>, <a class="el" href="cube_8c_source.html#l01003">demo_draw()</a>, and <a class="el" href="cube_8c_source.html#l03278">demo_init_vk_swapchain()</a>.</p>

</div>
</div>
<a class="anchor" id="ab5c664496b8f5564aac41b936cb8bbf8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define GET_DEVICE_PROC_ADDR</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">dev, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">entrypoint&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{                                                                                                            \</div><div class="line">        if (!<a class="code" href="cube_8c.html#ae47449d2c6ee5d67200b1d7e8ecec805">g_gdpa</a>) <a class="code" href="cube_8c.html#ae47449d2c6ee5d67200b1d7e8ecec805">g_gdpa</a> = (PFN_vkGetDeviceProcAddr)vkGetInstanceProcAddr(<a class="code" href="structdemo.html">demo</a>-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, &quot;vkGetDeviceProcAddr&quot;); \</div><div class="line">        <a class="code" href="structdemo.html">demo</a>-&gt;fp<span class="preprocessor">##entrypoint = (PFN_vk##entrypoint)g_gdpa(dev, &quot;vk&quot; #entrypoint);                                \</span></div><div class="line"><span class="preprocessor">        if (demo-&gt;fp##entrypoint == NULL) {                                                                      \</span></div><div class="line"><span class="preprocessor">            ERR_EXIT(&quot;vkGetDeviceProcAddr failed to find vk&quot; #entrypoint, &quot;vkGetDeviceProcAddr Failure&quot;);        \</span></div><div class="line"><span class="preprocessor">        }                                                                                                        \</span></div><div class="line"><span class="preprocessor">    }</span></div><div class="ttc" id="cube_8c_html_ae47449d2c6ee5d67200b1d7e8ecec805"><div class="ttname"><a href="cube_8c.html#ae47449d2c6ee5d67200b1d7e8ecec805">g_gdpa</a></div><div class="ttdeci">static PFN_vkGetDeviceProcAddr g_gdpa</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00146">cube.c:146</a></div></div>
<div class="ttc" id="structdemo_html_ad5052f1e07e9c04deaa9a1f8e4e13654"><div class="ttname"><a href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">demo::inst</a></div><div class="ttdeci">VkInstance inst</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00356">cube.c:356</a></div></div>
<div class="ttc" id="structdemo_html"><div class="ttname"><a href="structdemo.html">demo</a></div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00305">cube.c:305</a></div></div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="cube_8c_source.html#l00148">148</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l03278">demo_init_vk_swapchain()</a>.</p>

</div>
</div>
<a class="anchor" id="afe0326a2a1a9e72834ca67caab932c44"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define GET_INSTANCE_PROC_ADDR</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">inst, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">entrypoint&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{                                                                                                         \</div><div class="line">        demo-&gt;fp##entrypoint = (PFN_vk##entrypoint)vkGetInstanceProcAddr(<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, <span class="stringliteral">&quot;vk&quot;</span> #entrypoint);             \</div><div class="line">        if (<a class="code" href="structdemo.html">demo</a>-&gt;fp##entrypoint == NULL) {                                                                   \</div><div class="line">            ERR_EXIT(<span class="stringliteral">&quot;vkGetInstanceProcAddr failed to find vk&quot;</span> #entrypoint, <span class="stringliteral">&quot;vkGetInstanceProcAddr Failure&quot;</span>); \</div><div class="line">        }                                                                                                     \</div><div class="line">    }</div><div class="ttc" id="structdemo_html_ad5052f1e07e9c04deaa9a1f8e4e13654"><div class="ttname"><a href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">demo::inst</a></div><div class="ttdeci">VkInstance inst</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00356">cube.c:356</a></div></div>
<div class="ttc" id="structdemo_html"><div class="ttname"><a href="structdemo.html">demo</a></div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00305">cube.c:305</a></div></div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="cube_8c_source.html#l00138">138</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02849">demo_init_vk()</a>.</p>

</div>
</div>
<a class="anchor" id="a368e7704f92e34c8ea0a5c263a95a1b1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MILLION&#160;&#160;&#160;1000000L</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00063">63</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l00579">CanPresentEarlier()</a>.</p>

</div>
</div>
<a class="anchor" id="ab33dabc77056cb02bf8609c97d49716b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define U_ASSERT_ONLY</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00078">78</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l00836">demo_build_image_ownership_cmd()</a>, <a class="el" href="cube_8c_source.html#l03243">demo_create_device()</a>, <a class="el" href="cube_8c_source.html#l02387">demo_create_window()</a>, <a class="el" href="cube_8c_source.html#l01003">demo_draw()</a>, <a class="el" href="cube_8c_source.html#l00703">demo_draw_build_cmd()</a>, <a class="el" href="cube_8c_source.html#l00614">demo_flush_init_cmd()</a>, <a class="el" href="cube_8c_source.html#l03278">demo_init_vk_swapchain()</a>, <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>, <a class="el" href="cube_8c_source.html#l01171">demo_prepare_buffers()</a>, <a class="el" href="cube_8c_source.html#l01680">demo_prepare_cube_data_buffers()</a>, <a class="el" href="cube_8c_source.html#l01393">demo_prepare_depth()</a>, <a class="el" href="cube_8c_source.html#l01743">demo_prepare_descriptor_layout()</a>, <a class="el" href="cube_8c_source.html#l02004">demo_prepare_descriptor_pool()</a>, <a class="el" href="cube_8c_source.html#l02030">demo_prepare_descriptor_set()</a>, <a class="el" href="cube_8c_source.html#l02075">demo_prepare_framebuffers()</a>, <a class="el" href="cube_8c_source.html#l01887">demo_prepare_pipeline()</a>, <a class="el" href="cube_8c_source.html#l01784">demo_prepare_render_pass()</a>, <a class="el" href="cube_8c_source.html#l01856">demo_prepare_shader_module()</a>, <a class="el" href="cube_8c_source.html#l01491">demo_prepare_texture_image()</a>, <a class="el" href="cube_8c_source.html#l01574">demo_prepare_textures()</a>, <a class="el" href="cube_8c_source.html#l00865">demo_update_data_buffer()</a>, and <a class="el" href="cube_8c_source.html#l00887">DemoUpdateTargetIPD()</a>.</p>

</div>
</div>
<a class="anchor" id="addf5ec070e9499d36b7f2009ce736076"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define UNUSED</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00084">84</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02387">demo_create_window()</a>, and <a class="el" href="cube_8c_source.html#l03278">demo_init_vk_swapchain()</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ab9ca7a0a208ec589229116f2de6ee77c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ActualTimeLate </td>
          <td>(</td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>desired</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>actual</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>rdur</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00561">561</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l00887">DemoUpdateTargetIPD()</a>.</p>
<div class="fragment"><div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;                                                                      {</div><div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;    <span class="comment">// The desired time was the earliest time that the present should have</span></div><div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160;    <span class="comment">// occured.  In almost every case, the actual time should be later than the</span></div><div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;    <span class="comment">// desired time.  We should only consider the actual time &quot;late&quot; if it is</span></div><div class="line"><a name="l00565"></a><span class="lineno">  565</span>&#160;    <span class="comment">// after &quot;desired + rdur&quot;.</span></div><div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;    <span class="keywordflow">if</span> (actual &lt;= desired) {</div><div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;        <span class="comment">// The actual time was before or equal to the desired time.  This will</span></div><div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;        <span class="comment">// probably never happen, but in case it does, return false since the</span></div><div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;        <span class="comment">// present was obviously NOT late.</span></div><div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160;    }</div><div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;    uint64_t deadline = desired + rdur;</div><div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160;    <span class="keywordflow">if</span> (actual &gt; deadline) {</div><div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;    }</div><div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;}</div></div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ab9ca7a0a208ec589229116f2de6ee77c_icgraph.png" border="0" usemap="#cube_8c_ab9ca7a0a208ec589229116f2de6ee77c_icgraph" alt=""/></div>
<map name="cube_8c_ab9ca7a0a208ec589229116f2de6ee77c_icgraph" id="cube_8c_ab9ca7a0a208ec589229116f2de6ee77c_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="165,97,320,124"/>
<area shape="rect" id="node3" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="368,97,456,124"/>
<area shape="rect" id="node4" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="504,59,583,85"/>
<area shape="rect" id="node6" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="755,59,901,85"/>
<area shape="rect" id="node5" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="631,33,707,60"/>
<area shape="rect" id="node7" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="949,21,1023,48"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="aef0d76102bd69a61b3bc49beecae77ca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool CanPresentEarlier </td>
          <td>(</td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>earliest</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>actual</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>margin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>rdur</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00579">579</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l02283">demo_resize()</a>, and <a class="el" href="cube_8c_source.html#l00063">MILLION</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l00887">DemoUpdateTargetIPD()</a>.</p>
<div class="fragment"><div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;                                                                                           {</div><div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160;    <span class="keywordflow">if</span> (earliest &lt; actual) {</div><div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;        <span class="comment">// Consider whether this present could have occured earlier.  Make sure</span></div><div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;        <span class="comment">// that earliest time was at least 2msec earlier than actual time, and</span></div><div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;        <span class="comment">// that the margin was at least 2msec:</span></div><div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;        uint64_t diff = actual - earliest;</div><div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;        <span class="keywordflow">if</span> ((diff &gt;= (2 * <a class="code" href="cube_8c.html#a368e7704f92e34c8ea0a5c263a95a1b1">MILLION</a>)) &amp;&amp; (margin &gt;= (2 * <a class="code" href="cube_8c.html#a368e7704f92e34c8ea0a5c263a95a1b1">MILLION</a>))) {</div><div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;            <span class="comment">// This present could have occured earlier because both: 1) the</span></div><div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;            <span class="comment">// earliest time was at least 2 msec before actual time, and 2) the</span></div><div class="line"><a name="l00588"></a><span class="lineno">  588</span>&#160;            <span class="comment">// margin was at least 2msec.</span></div><div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;        }</div><div class="line"><a name="l00591"></a><span class="lineno">  591</span>&#160;    }</div><div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;}</div><div class="ttc" id="cube_8c_html_a368e7704f92e34c8ea0a5c263a95a1b1"><div class="ttname"><a href="cube_8c.html#a368e7704f92e34c8ea0a5c263a95a1b1">MILLION</a></div><div class="ttdeci">#define MILLION</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00063">cube.c:63</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_aef0d76102bd69a61b3bc49beecae77ca_cgraph.png" border="0" usemap="#cube_8c_aef0d76102bd69a61b3bc49beecae77ca_cgraph" alt=""/></div>
<map name="cube_8c_aef0d76102bd69a61b3bc49beecae77ca_cgraph" id="cube_8c_aef0d76102bd69a61b3bc49beecae77ca_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="180,371,276,398"/>
<area shape="rect" id="node3" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="324,371,428,398"/>
<area shape="rect" id="node4" href="cube_8c.html#a0c4cc92dc1a3456d6cca76e3187f2010" title="demo_prepare_buffers" alt="" coords="515,25,664,51"/>
<area shape="rect" id="node5" href="cube_8c.html#a3569c83afeb4ecc4d8d797af29ce89ed" title="demo_prepare_depth" alt="" coords="765,189,907,215"/>
<area shape="rect" id="node7" href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7" title="demo_prepare_textures" alt="" coords="510,75,669,102"/>
<area shape="rect" id="node11" href="cube_8c.html#a21da8dc23d75bc75b5dbe7dd01130739" title="demo_prepare_cube_data\l_buffers" alt="" coords="751,123,921,164"/>
<area shape="rect" id="node12" href="cube_8c.html#a36308c10e305d94d63e96fc82be78950" title="demo_prepare_descriptor\l_layout" alt="" coords="505,229,673,271"/>
<area shape="rect" id="node13" href="cube_8c.html#a4ac6098487e1fc2305847f666891cdec" title="demo_prepare_render_pass" alt="" coords="498,295,681,322"/>
<area shape="rect" id="node14" href="cube_8c.html#aa80cd8877b6b5d20217c451b207ca9d9" title="demo_prepare_pipeline" alt="" coords="512,346,667,373"/>
<area shape="rect" id="node18" href="cube_8c.html#ad1571a7e9407fa30327f858d07ea6702" title="demo_build_image_ownership_cmd" alt="" coords="476,397,703,423"/>
<area shape="rect" id="node19" href="cube_8c.html#a4ee7f5efc65c5972db015c6be8cda380" title="demo_prepare_descriptor_pool" alt="" coords="490,447,689,474"/>
<area shape="rect" id="node20" href="cube_8c.html#ac1957f225fabd1755a0064169fa5f6ba" title="demo_prepare_descriptor_set" alt="" coords="493,498,686,525"/>
<area shape="rect" id="node21" href="cube_8c.html#a3a72610dc44a370494307b568ef3abd6" title="demo_prepare_framebuffers" alt="" coords="499,549,680,575"/>
<area shape="rect" id="node22" href="cube_8c.html#aa9f275ddb85f8473f44c01a00ccfba63" title="demo_draw_build_cmd" alt="" coords="512,599,667,626"/>
<area shape="rect" id="node23" href="cube_8c.html#a7a35f4639d32b3ac59dd725668a363ba" title="demo_flush_init_cmd" alt="" coords="517,650,661,677"/>
<area shape="rect" id="node24" href="cube_8c.html#a10612fc5c33836b531554ee572b389f2" title="demo_destroy_texture\l_image" alt="" coords="514,701,665,743"/>
<area shape="rect" id="node6" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b" title="memory_type_from_properties" alt="" coords="969,130,1167,157"/>
<area shape="rect" id="node8" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731" title="demo_prepare_texture\l_image" alt="" coords="761,5,911,47"/>
<area shape="rect" id="node10" href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8" title="demo_set_image_layout" alt="" coords="755,71,917,98"/>
<area shape="rect" id="node9" href="cube_8c.html#add4fd1e03edd51503c9c554e77a042fa" title="loadTexture" alt="" coords="1023,13,1113,39"/>
<area shape="rect" id="node15" href="cube_8c.html#ab1d134177a8964ce85593b229fc7f688" title="demo_prepare_vs" alt="" coords="775,321,897,347"/>
<area shape="rect" id="node17" href="cube_8c.html#ab89d9436b88fd3dea5de8cb03de51e94" title="demo_prepare_fs" alt="" coords="775,371,897,398"/>
<area shape="rect" id="node16" href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c" title="demo_prepare_shader\l_module" alt="" coords="993,339,1143,380"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_aef0d76102bd69a61b3bc49beecae77ca_icgraph.png" border="0" usemap="#cube_8c_aef0d76102bd69a61b3bc49beecae77ca_icgraph" alt=""/></div>
<map name="cube_8c_aef0d76102bd69a61b3bc49beecae77ca_icgraph" id="cube_8c_aef0d76102bd69a61b3bc49beecae77ca_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="180,97,335,124"/>
<area shape="rect" id="node3" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="383,97,471,124"/>
<area shape="rect" id="node4" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="519,59,597,85"/>
<area shape="rect" id="node6" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="769,59,916,85"/>
<area shape="rect" id="node5" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="645,33,721,60"/>
<area shape="rect" id="node7" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="964,21,1037,48"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a1714a35ca475fd30144cd4090d94d286"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void DbgMsg </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>fmt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00129">129</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02849">demo_init_vk()</a>.</p>
<div class="fragment"><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;                            {</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    va_list va;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    va_start(va, fmt);</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    printf(fmt, va);</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    fflush(stdout);</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    va_end(va);</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;}</div></div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a1714a35ca475fd30144cd4090d94d286_icgraph.png" border="0" usemap="#cube_8c_a1714a35ca475fd30144cd4090d94d286_icgraph" alt=""/></div>
<map name="cube_8c_a1714a35ca475fd30144cd4090d94d286_icgraph" id="cube_8c_a1714a35ca475fd30144cd4090d94d286_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#abdcd6d1f2fdbb957fd5c0337d86a286c" title="demo_init_vk" alt="" coords="124,5,221,32"/>
<area shape="rect" id="node3" href="cube_8c.html#a9614fd51f6e418355a34964db328d781" title="demo_init" alt="" coords="269,5,348,32"/>
<area shape="rect" id="node4" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="396,5,469,32"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a47431f229fafc6047bb34487ee34151a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VKAPI_ATTR VkBool32 VKAPI_CALL debug_messenger_callback </td>
          <td>(</td>
          <td class="paramtype">VkDebugUtilsMessageSeverityFlagBitsEXT&#160;</td>
          <td class="paramname"><em>messageSeverity</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VkDebugUtilsMessageTypeFlagsEXT&#160;</td>
          <td class="paramname"><em>messageType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const VkDebugUtilsMessengerCallbackDataEXT *&#160;</td>
          <td class="paramname"><em>pCallbackData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>pUserData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00453">453</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00067">APP_SHORT_NAME</a>, <a class="el" href="cube_8c_source.html#l00438">demo::suppress_popups</a>, <a class="el" href="cube_8c_source.html#l00437">demo::use_break</a>, and <a class="el" href="cube_8c_source.html#l00174">validation_error</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02849">demo_init_vk()</a>.</p>
<div class="fragment"><div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;                                                                         {</div><div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;    <span class="keywordtype">char</span> prefix[64] = <span class="stringliteral">&quot;&quot;</span>;</div><div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;    <span class="keywordtype">char</span> *message = (<span class="keywordtype">char</span> *)malloc(strlen(pCallbackData-&gt;pMessage) + 5000);</div><div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;    assert(message);</div><div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;    <span class="keyword">struct </span><a class="code" href="structdemo.html">demo</a> *<a class="code" href="structdemo.html">demo</a> = (<span class="keyword">struct </span>demo *)pUserData;</div><div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;</div><div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a8c231f3030fd6fdba515005a861bbe1a">use_break</a>) {</div><div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;<span class="preprocessor">#ifndef WIN32</span></div><div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;        <span class="keyword">raise</span>(SIGTRAP);</div><div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;        DebugBreak();</div><div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;    }</div><div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;</div><div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;    <span class="keywordflow">if</span> (messageSeverity &amp; VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT) {</div><div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;        strcat(prefix, <span class="stringliteral">&quot;VERBOSE : &quot;</span>);</div><div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (messageSeverity &amp; VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT) {</div><div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;        strcat(prefix, <span class="stringliteral">&quot;INFO : &quot;</span>);</div><div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (messageSeverity &amp; VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) {</div><div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;        strcat(prefix, <span class="stringliteral">&quot;WARNING : &quot;</span>);</div><div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (messageSeverity &amp; VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) {</div><div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;        strcat(prefix, <span class="stringliteral">&quot;ERROR : &quot;</span>);</div><div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;    }</div><div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;</div><div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;    <span class="keywordflow">if</span> (messageType &amp; VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT) {</div><div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;        strcat(prefix, <span class="stringliteral">&quot;GENERAL&quot;</span>);</div><div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;        <span class="keywordflow">if</span> (messageType &amp; VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT) {</div><div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;            strcat(prefix, <span class="stringliteral">&quot;VALIDATION&quot;</span>);</div><div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;            <a class="code" href="cube_8c.html#aa2a7e938c1d845c6a71f43750db0fd07">validation_error</a> = 1;</div><div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;        }</div><div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;        <span class="keywordflow">if</span> (messageType &amp; VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT) {</div><div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;            <span class="keywordflow">if</span> (messageType &amp; VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT) {</div><div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;                strcat(prefix, <span class="stringliteral">&quot;|&quot;</span>);</div><div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;            }</div><div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;            strcat(prefix, <span class="stringliteral">&quot;PERFORMANCE&quot;</span>);</div><div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;        }</div><div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;    }</div><div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;</div><div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;    sprintf(message, <span class="stringliteral">&quot;%s - Message Id Number: %d | Message Id Name: %s\n\t%s\n&quot;</span>, prefix, pCallbackData-&gt;messageIdNumber,</div><div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;            pCallbackData-&gt;pMessageIdName, pCallbackData-&gt;pMessage);</div><div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;    <span class="keywordflow">if</span> (pCallbackData-&gt;objectCount &gt; 0) {</div><div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;        <span class="keywordtype">char</span> tmp_message[500];</div><div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;        sprintf(tmp_message, <span class="stringliteral">&quot;\n\tObjects - %d\n&quot;</span>, pCallbackData-&gt;objectCount);</div><div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;        strcat(message, tmp_message);</div><div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;        <span class="keywordflow">for</span> (uint32_t <span class="keywordtype">object</span> = 0; <span class="keywordtype">object</span> &lt; pCallbackData-&gt;objectCount; ++object) {</div><div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;            <span class="keywordflow">if</span> (NULL != pCallbackData-&gt;pObjects[<span class="keywordtype">object</span>].pObjectName &amp;&amp; strlen(pCallbackData-&gt;pObjects[<span class="keywordtype">object</span>].pObjectName) &gt; 0) {</div><div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;                sprintf(tmp_message, <span class="stringliteral">&quot;\t\tObject[%d] - %s, Handle %p, Name \&quot;%s\&quot;\n&quot;</span>, <span class="keywordtype">object</span>,</div><div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;                        string_VkObjectType(pCallbackData-&gt;pObjects[<span class="keywordtype">object</span>].objectType),</div><div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;                        (<span class="keywordtype">void</span> *)(pCallbackData-&gt;pObjects[<span class="keywordtype">object</span>].objectHandle), pCallbackData-&gt;pObjects[<span class="keywordtype">object</span>].pObjectName);</div><div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160;            } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;                sprintf(tmp_message, <span class="stringliteral">&quot;\t\tObject[%d] - %s, Handle %p\n&quot;</span>, <span class="keywordtype">object</span>,</div><div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;                        string_VkObjectType(pCallbackData-&gt;pObjects[<span class="keywordtype">object</span>].objectType),</div><div class="line"><a name="l00509"></a><span class="lineno">  509</span>&#160;                        (<span class="keywordtype">void</span> *)(pCallbackData-&gt;pObjects[<span class="keywordtype">object</span>].objectHandle));</div><div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;            }</div><div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;            strcat(message, tmp_message);</div><div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;        }</div><div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;    }</div><div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;    <span class="keywordflow">if</span> (pCallbackData-&gt;cmdBufLabelCount &gt; 0) {</div><div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;        <span class="keywordtype">char</span> tmp_message[500];</div><div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;        sprintf(tmp_message, <span class="stringliteral">&quot;\n\tCommand Buffer Labels - %d\n&quot;</span>, pCallbackData-&gt;cmdBufLabelCount);</div><div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;        strcat(message, tmp_message);</div><div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160;        <span class="keywordflow">for</span> (uint32_t cmd_buf_label = 0; cmd_buf_label &lt; pCallbackData-&gt;cmdBufLabelCount; ++cmd_buf_label) {</div><div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160;            sprintf(tmp_message, <span class="stringliteral">&quot;\t\tLabel[%d] - %s { %f, %f, %f, %f}\n&quot;</span>, cmd_buf_label,</div><div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;                    pCallbackData-&gt;pCmdBufLabels[cmd_buf_label].pLabelName, pCallbackData-&gt;pCmdBufLabels[cmd_buf_label].color[0],</div><div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;                    pCallbackData-&gt;pCmdBufLabels[cmd_buf_label].color[1], pCallbackData-&gt;pCmdBufLabels[cmd_buf_label].color[2],</div><div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160;                    pCallbackData-&gt;pCmdBufLabels[cmd_buf_label].color[3]);</div><div class="line"><a name="l00523"></a><span class="lineno">  523</span>&#160;            strcat(message, tmp_message);</div><div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;        }</div><div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160;    }</div><div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160;</div><div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160;<span class="preprocessor">#ifdef _WIN32</span></div><div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;</div><div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;    in_callback = <span class="keyword">true</span>;</div><div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160;    <span class="keywordflow">if</span> (!demo-&gt;<a class="code" href="structdemo.html#a0fd8ef6b13e48ea7e550a0a8368ffd81">suppress_popups</a>)</div><div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;        MessageBox(NULL, message, <span class="stringliteral">&quot;Alert&quot;</span>, MB_OK);</div><div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;    in_callback = <span class="keyword">false</span>;</div><div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;</div><div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;<span class="preprocessor">#elif defined(ANDROID)</span></div><div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160;</div><div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;    <span class="keywordflow">if</span> (messageSeverity &amp; VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT) {</div><div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160;        __android_log_print(ANDROID_LOG_INFO,  <a class="code" href="cube_8c.html#ab5541e08a357bb88cd008693b6ffc6db">APP_SHORT_NAME</a>, <span class="stringliteral">&quot;%s&quot;</span>, message);</div><div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (messageSeverity &amp; VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) {</div><div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;        __android_log_print(ANDROID_LOG_WARN,  <a class="code" href="cube_8c.html#ab5541e08a357bb88cd008693b6ffc6db">APP_SHORT_NAME</a>, <span class="stringliteral">&quot;%s&quot;</span>, message);</div><div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (messageSeverity &amp; VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) {</div><div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;        __android_log_print(ANDROID_LOG_ERROR, <a class="code" href="cube_8c.html#ab5541e08a357bb88cd008693b6ffc6db">APP_SHORT_NAME</a>, <span class="stringliteral">&quot;%s&quot;</span>, message);</div><div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (messageSeverity &amp; VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT) {</div><div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;        __android_log_print(ANDROID_LOG_VERBOSE, <a class="code" href="cube_8c.html#ab5541e08a357bb88cd008693b6ffc6db">APP_SHORT_NAME</a>, <span class="stringliteral">&quot;%s&quot;</span>, message);</div><div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00545"></a><span class="lineno">  545</span>&#160;        __android_log_print(ANDROID_LOG_INFO,  <a class="code" href="cube_8c.html#ab5541e08a357bb88cd008693b6ffc6db">APP_SHORT_NAME</a>, <span class="stringliteral">&quot;%s&quot;</span>, message);</div><div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160;    }</div><div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;</div><div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;</div><div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160;    printf(<span class="stringliteral">&quot;%s\n&quot;</span>, message);</div><div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;    fflush(stdout);</div><div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;</div><div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;</div><div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;    free(message);</div><div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;</div><div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;    <span class="comment">// Don&#39;t bail out, but keep going.</span></div><div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;}</div><div class="ttc" id="cube_8c_html_aa2a7e938c1d845c6a71f43750db0fd07"><div class="ttname"><a href="cube_8c.html#aa2a7e938c1d845c6a71f43750db0fd07">validation_error</a></div><div class="ttdeci">static int validation_error</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00174">cube.c:174</a></div></div>
<div class="ttc" id="structdemo_html_a0fd8ef6b13e48ea7e550a0a8368ffd81"><div class="ttname"><a href="structdemo.html#a0fd8ef6b13e48ea7e550a0a8368ffd81">demo::suppress_popups</a></div><div class="ttdeci">bool suppress_popups</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00438">cube.c:438</a></div></div>
<div class="ttc" id="structdemo_html_a8c231f3030fd6fdba515005a861bbe1a"><div class="ttname"><a href="structdemo.html#a8c231f3030fd6fdba515005a861bbe1a">demo::use_break</a></div><div class="ttdeci">bool use_break</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00437">cube.c:437</a></div></div>
<div class="ttc" id="cube_8c_html_ab5541e08a357bb88cd008693b6ffc6db"><div class="ttname"><a href="cube_8c.html#ab5541e08a357bb88cd008693b6ffc6db">APP_SHORT_NAME</a></div><div class="ttdeci">#define APP_SHORT_NAME</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00067">cube.c:67</a></div></div>
<div class="ttc" id="structdemo_html"><div class="ttname"><a href="structdemo.html">demo</a></div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00305">cube.c:305</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a47431f229fafc6047bb34487ee34151a_icgraph.png" border="0" usemap="#cube_8c_a47431f229fafc6047bb34487ee34151a_icgraph" alt=""/></div>
<map name="cube_8c_a47431f229fafc6047bb34487ee34151a_icgraph" id="cube_8c_a47431f229fafc6047bb34487ee34151a_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#abdcd6d1f2fdbb957fd5c0337d86a286c" title="demo_init_vk" alt="" coords="236,5,333,32"/>
<area shape="rect" id="node3" href="cube_8c.html#a9614fd51f6e418355a34964db328d781" title="demo_init" alt="" coords="381,5,460,32"/>
<area shape="rect" id="node4" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="508,5,581,32"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ad1571a7e9407fa30327f858d07ea6702"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void demo_build_image_ownership_cmd </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00836">836</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00361">demo::graphics_queue_family_index</a>, <a class="el" href="cube_8c_source.html#l00297">SwapchainImageResources::graphics_to_present_cmd</a>, <a class="el" href="cube_8c_source.html#l00295">SwapchainImageResources::image</a>, <a class="el" href="cube_8c_source.html#l00362">demo::present_queue_family_index</a>, <a class="el" href="cube_8c_source.html#l00392">demo::swapchain_image_resources</a>, and <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>.</p>
<div class="fragment"><div class="line"><a name="l00836"></a><span class="lineno">  836</span>&#160;                                                              {</div><div class="line"><a name="l00837"></a><span class="lineno">  837</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l00838"></a><span class="lineno">  838</span>&#160;</div><div class="line"><a name="l00839"></a><span class="lineno">  839</span>&#160;    <span class="keyword">const</span> VkCommandBufferBeginInfo cmd_buf_info = {</div><div class="line"><a name="l00840"></a><span class="lineno">  840</span>&#160;        .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,</div><div class="line"><a name="l00841"></a><span class="lineno">  841</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l00842"></a><span class="lineno">  842</span>&#160;        .flags = VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT,</div><div class="line"><a name="l00843"></a><span class="lineno">  843</span>&#160;        .pInheritanceInfo = NULL,</div><div class="line"><a name="l00844"></a><span class="lineno">  844</span>&#160;    };</div><div class="line"><a name="l00845"></a><span class="lineno">  845</span>&#160;    err = vkBeginCommandBuffer(demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a7dc70d5748a9ff416efe19a67ad8e8f8">graphics_to_present_cmd</a>, &amp;cmd_buf_info);</div><div class="line"><a name="l00846"></a><span class="lineno">  846</span>&#160;    assert(!err);</div><div class="line"><a name="l00847"></a><span class="lineno">  847</span>&#160;</div><div class="line"><a name="l00848"></a><span class="lineno">  848</span>&#160;    VkImageMemoryBarrier image_ownership_barrier = {.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,</div><div class="line"><a name="l00849"></a><span class="lineno">  849</span>&#160;                                                    .pNext = NULL,</div><div class="line"><a name="l00850"></a><span class="lineno">  850</span>&#160;                                                    .srcAccessMask = 0,</div><div class="line"><a name="l00851"></a><span class="lineno">  851</span>&#160;                                                    .dstAccessMask = 0,</div><div class="line"><a name="l00852"></a><span class="lineno">  852</span>&#160;                                                    .oldLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,</div><div class="line"><a name="l00853"></a><span class="lineno">  853</span>&#160;                                                    .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,</div><div class="line"><a name="l00854"></a><span class="lineno">  854</span>&#160;                                                    .srcQueueFamilyIndex = demo-&gt;<a class="code" href="structdemo.html#a9f7e94f1331e93955bcfdfb6596fedc1">graphics_queue_family_index</a>,</div><div class="line"><a name="l00855"></a><span class="lineno">  855</span>&#160;                                                    .dstQueueFamilyIndex = demo-&gt;<a class="code" href="structdemo.html#a8e9f41863731d6ab805b8d632f3d0c9d">present_queue_family_index</a>,</div><div class="line"><a name="l00856"></a><span class="lineno">  856</span>&#160;                                                    .image = demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a7faad0d9bcbbb48a1ac11db12f81420c">image</a>,</div><div class="line"><a name="l00857"></a><span class="lineno">  857</span>&#160;                                                    .subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1}};</div><div class="line"><a name="l00858"></a><span class="lineno">  858</span>&#160;</div><div class="line"><a name="l00859"></a><span class="lineno">  859</span>&#160;    vkCmdPipelineBarrier(demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a7dc70d5748a9ff416efe19a67ad8e8f8">graphics_to_present_cmd</a>, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,</div><div class="line"><a name="l00860"></a><span class="lineno">  860</span>&#160;                         VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, 0, NULL, 0, NULL, 1, &amp;image_ownership_barrier);</div><div class="line"><a name="l00861"></a><span class="lineno">  861</span>&#160;    err = vkEndCommandBuffer(demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a7dc70d5748a9ff416efe19a67ad8e8f8">graphics_to_present_cmd</a>);</div><div class="line"><a name="l00862"></a><span class="lineno">  862</span>&#160;    assert(!err);</div><div class="line"><a name="l00863"></a><span class="lineno">  863</span>&#160;}</div><div class="ttc" id="structdemo_html_a8e9f41863731d6ab805b8d632f3d0c9d"><div class="ttname"><a href="structdemo.html#a8e9f41863731d6ab805b8d632f3d0c9d">demo::present_queue_family_index</a></div><div class="ttdeci">uint32_t present_queue_family_index</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00362">cube.c:362</a></div></div>
<div class="ttc" id="structdemo_html_a139cab94cb0a578562759d7f315ca0b5"><div class="ttname"><a href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">demo::swapchain_image_resources</a></div><div class="ttdeci">SwapchainImageResources * swapchain_image_resources</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00392">cube.c:392</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a7faad0d9bcbbb48a1ac11db12f81420c"><div class="ttname"><a href="struct_swapchain_image_resources.html#a7faad0d9bcbbb48a1ac11db12f81420c">SwapchainImageResources::image</a></div><div class="ttdeci">VkImage image</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00295">cube.c:295</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_a9f7e94f1331e93955bcfdfb6596fedc1"><div class="ttname"><a href="structdemo.html#a9f7e94f1331e93955bcfdfb6596fedc1">demo::graphics_queue_family_index</a></div><div class="ttdeci">uint32_t graphics_queue_family_index</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00361">cube.c:361</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a7dc70d5748a9ff416efe19a67ad8e8f8"><div class="ttname"><a href="struct_swapchain_image_resources.html#a7dc70d5748a9ff416efe19a67ad8e8f8">SwapchainImageResources::graphics_to_present_cmd</a></div><div class="ttdeci">VkCommandBuffer graphics_to_present_cmd</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00297">cube.c:297</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ad1571a7e9407fa30327f858d07ea6702_icgraph.png" border="0" usemap="#cube_8c_ad1571a7e9407fa30327f858d07ea6702_icgraph" alt=""/></div>
<map name="cube_8c_ad1571a7e9407fa30327f858d07ea6702_icgraph" id="cube_8c_ad1571a7e9407fa30327f858d07ea6702_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="280,43,384,69"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="432,93,528,120"/>
<area shape="rect" id="node10" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1535,119,1608,145"/>
<area shape="rect" id="node4" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="576,144,703,171"/>
<area shape="rect" id="node6" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="953,119,1041,145"/>
<area shape="rect" id="node8" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1216,245,1292,272"/>
<area shape="rect" id="node9" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1340,119,1487,145"/>
<area shape="rect" id="node5" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="751,144,905,171"/>
<area shape="rect" id="node7" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1089,156,1168,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="abcfbf263b3a2885f094ece366b4c2a5b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static VkBool32 demo_check_layers </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>check_count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>check_names</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>layer_count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VkLayerProperties *&#160;</td>
          <td class="paramname"><em>layers</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l02832">2832</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02849">demo_init_vk()</a>.</p>
<div class="fragment"><div class="line"><a name="l02832"></a><span class="lineno"> 2832</span>&#160;                                                                                                                             {</div><div class="line"><a name="l02833"></a><span class="lineno"> 2833</span>&#160;    <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; check_count; i++) {</div><div class="line"><a name="l02834"></a><span class="lineno"> 2834</span>&#160;        VkBool32 found = 0;</div><div class="line"><a name="l02835"></a><span class="lineno"> 2835</span>&#160;        <span class="keywordflow">for</span> (uint32_t j = 0; j &lt; layer_count; j++) {</div><div class="line"><a name="l02836"></a><span class="lineno"> 2836</span>&#160;            <span class="keywordflow">if</span> (!strcmp(check_names[i], layers[j].layerName)) {</div><div class="line"><a name="l02837"></a><span class="lineno"> 2837</span>&#160;                found = 1;</div><div class="line"><a name="l02838"></a><span class="lineno"> 2838</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l02839"></a><span class="lineno"> 2839</span>&#160;            }</div><div class="line"><a name="l02840"></a><span class="lineno"> 2840</span>&#160;        }</div><div class="line"><a name="l02841"></a><span class="lineno"> 2841</span>&#160;        <span class="keywordflow">if</span> (!found) {</div><div class="line"><a name="l02842"></a><span class="lineno"> 2842</span>&#160;            fprintf(stderr, <span class="stringliteral">&quot;Cannot find layer: %s\n&quot;</span>, check_names[i]);</div><div class="line"><a name="l02843"></a><span class="lineno"> 2843</span>&#160;            <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l02844"></a><span class="lineno"> 2844</span>&#160;        }</div><div class="line"><a name="l02845"></a><span class="lineno"> 2845</span>&#160;    }</div><div class="line"><a name="l02846"></a><span class="lineno"> 2846</span>&#160;    <span class="keywordflow">return</span> 1;</div><div class="line"><a name="l02847"></a><span class="lineno"> 2847</span>&#160;}</div></div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_abcfbf263b3a2885f094ece366b4c2a5b_icgraph.png" border="0" usemap="#cube_8c_abcfbf263b3a2885f094ece366b4c2a5b_icgraph" alt=""/></div>
<map name="cube_8c_abcfbf263b3a2885f094ece366b4c2a5b_icgraph" id="cube_8c_abcfbf263b3a2885f094ece366b4c2a5b_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#abdcd6d1f2fdbb957fd5c0337d86a286c" title="demo_init_vk" alt="" coords="192,5,289,32"/>
<area shape="rect" id="node3" href="cube_8c.html#a9614fd51f6e418355a34964db328d781" title="demo_init" alt="" coords="337,5,416,32"/>
<area shape="rect" id="node4" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="464,5,537,32"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ae1040d749c8bf35f9b48f04879e65928"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_cleanup </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l02197">2197</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00296">SwapchainImageResources::cmd</a>, <a class="el" href="cube_8c_source.html#l00397">demo::cmd_pool</a>, <a class="el" href="cube_8c_source.html#l00308">demo::connection</a>, <a class="el" href="cube_8c_source.html#l00447">demo::dbg_messenger</a>, <a class="el" href="cube_8c_source.html#l00066">DEMO_TEXTURE_COUNT</a>, <a class="el" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">demo::depth</a>, <a class="el" href="cube_8c_source.html#l00414">demo::desc_layout</a>, <a class="el" href="cube_8c_source.html#l00430">demo::desc_pool</a>, <a class="el" href="cube_8c_source.html#l00441">demo::DestroyDebugUtilsMessengerEXT</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00364">demo::draw_complete_semaphores</a>, <a class="el" href="cube_8c_source.html#l00394">demo::fences</a>, <a class="el" href="cube_8c_source.html#l00384">demo::fpDestroySwapchainKHR</a>, <a class="el" href="cube_8c_source.html#l00071">FRAME_LAG</a>, <a class="el" href="cube_8c_source.html#l00301">SwapchainImageResources::framebuffer</a>, <a class="el" href="cube_8c_source.html#l00163">texture_object::image</a>, <a class="el" href="cube_8c_source.html#l00403">demo::image</a>, <a class="el" href="cube_8c_source.html#l00363">demo::image_acquired_semaphores</a>, <a class="el" href="cube_8c_source.html#l00365">demo::image_ownership_semaphores</a>, <a class="el" href="cube_8c_source.html#l00356">demo::inst</a>, <a class="el" href="cube_8c_source.html#l00342">demo::is_minimized</a>, <a class="el" href="cube_8c_source.html#l00167">texture_object::mem</a>, <a class="el" href="cube_8c_source.html#l00405">demo::mem</a>, <a class="el" href="cube_8c_source.html#l00417">demo::pipeline</a>, <a class="el" href="cube_8c_source.html#l00413">demo::pipeline_layout</a>, <a class="el" href="cube_8c_source.html#l00415">demo::pipelineCache</a>, <a class="el" href="cube_8c_source.html#l00339">demo::prepared</a>, <a class="el" href="cube_8c_source.html#l00398">demo::present_cmd_pool</a>, <a class="el" href="cube_8c_source.html#l00367">demo::queue_props</a>, <a class="el" href="cube_8c_source.html#l00416">demo::render_pass</a>, <a class="el" href="cube_8c_source.html#l00161">texture_object::sampler</a>, <a class="el" href="cube_8c_source.html#l00341">demo::separate_present_queue</a>, <a class="el" href="cube_8c_source.html#l00338">demo::surface</a>, <a class="el" href="cube_8c_source.html#l00391">demo::swapchain</a>, <a class="el" href="cube_8c_source.html#l00392">demo::swapchain_image_resources</a>, <a class="el" href="cube_8c_source.html#l00390">demo::swapchainImageCount</a>, <a class="el" href="cube_8c_source.html#l00409">demo::textures</a>, <a class="el" href="cube_8c_source.html#l00299">SwapchainImageResources::uniform_buffer</a>, <a class="el" href="cube_8c_source.html#l00300">SwapchainImageResources::uniform_memory</a>, <a class="el" href="cube_8c_source.html#l00435">demo::validate</a>, <a class="el" href="cube_8c_source.html#l00168">texture_object::view</a>, <a class="el" href="cube_8c_source.html#l00298">SwapchainImageResources::view</a>, <a class="el" href="cube_8c_source.html#l00406">demo::view</a>, and <a class="el" href="cube_8c_source.html#l00310">demo::window</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l03702">WinMain()</a>.</p>
<div class="fragment"><div class="line"><a name="l02197"></a><span class="lineno"> 2197</span>&#160;                                            {</div><div class="line"><a name="l02198"></a><span class="lineno"> 2198</span>&#160;    uint32_t i;</div><div class="line"><a name="l02199"></a><span class="lineno"> 2199</span>&#160;</div><div class="line"><a name="l02200"></a><span class="lineno"> 2200</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a37de313a90cfadb40755d35e8d70f704">prepared</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l02201"></a><span class="lineno"> 2201</span>&#160;    vkDeviceWaitIdle(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>);</div><div class="line"><a name="l02202"></a><span class="lineno"> 2202</span>&#160;</div><div class="line"><a name="l02203"></a><span class="lineno"> 2203</span>&#160;    <span class="comment">// Wait for fences from present operations</span></div><div class="line"><a name="l02204"></a><span class="lineno"> 2204</span>&#160;    <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code" href="cube_8c.html#a44a58ed35161ff13de8fbf41f913a729">FRAME_LAG</a>; i++) {</div><div class="line"><a name="l02205"></a><span class="lineno"> 2205</span>&#160;        vkWaitForFences(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, 1, &amp;demo-&gt;<a class="code" href="structdemo.html#aee60ae051d1ee577f267ecc3b8da36ef">fences</a>[i], VK_TRUE, UINT64_MAX);</div><div class="line"><a name="l02206"></a><span class="lineno"> 2206</span>&#160;        vkDestroyFence(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#aee60ae051d1ee577f267ecc3b8da36ef">fences</a>[i], NULL);</div><div class="line"><a name="l02207"></a><span class="lineno"> 2207</span>&#160;        vkDestroySemaphore(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#ae0d984aad2f9eb0779c6ec09df17d183">image_acquired_semaphores</a>[i], NULL);</div><div class="line"><a name="l02208"></a><span class="lineno"> 2208</span>&#160;        vkDestroySemaphore(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#ab86850eb961f077b1c65bbfa50f4111e">draw_complete_semaphores</a>[i], NULL);</div><div class="line"><a name="l02209"></a><span class="lineno"> 2209</span>&#160;        <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">separate_present_queue</a>) {</div><div class="line"><a name="l02210"></a><span class="lineno"> 2210</span>&#160;            vkDestroySemaphore(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a2bba0ce9e5e1866670c37cec1ed784c5">image_ownership_semaphores</a>[i], NULL);</div><div class="line"><a name="l02211"></a><span class="lineno"> 2211</span>&#160;        }</div><div class="line"><a name="l02212"></a><span class="lineno"> 2212</span>&#160;    }</div><div class="line"><a name="l02213"></a><span class="lineno"> 2213</span>&#160;</div><div class="line"><a name="l02214"></a><span class="lineno"> 2214</span>&#160;    <span class="comment">// If the window is currently minimized, demo_resize has already done some cleanup for us.</span></div><div class="line"><a name="l02215"></a><span class="lineno"> 2215</span>&#160;    <span class="keywordflow">if</span> (!demo-&gt;<a class="code" href="structdemo.html#ac2570a83ce706add3b8a07673237f30c">is_minimized</a>) {</div><div class="line"><a name="l02216"></a><span class="lineno"> 2216</span>&#160;        <span class="keywordflow">for</span> (i = 0; i &lt; demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>; i++) {</div><div class="line"><a name="l02217"></a><span class="lineno"> 2217</span>&#160;            vkDestroyFramebuffer(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a09729b546f1f1017e0052fd076299776">framebuffer</a>, NULL);</div><div class="line"><a name="l02218"></a><span class="lineno"> 2218</span>&#160;        }</div><div class="line"><a name="l02219"></a><span class="lineno"> 2219</span>&#160;        vkDestroyDescriptorPool(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a20263af0f46296860c8053ee113fa9f8">desc_pool</a>, NULL);</div><div class="line"><a name="l02220"></a><span class="lineno"> 2220</span>&#160;</div><div class="line"><a name="l02221"></a><span class="lineno"> 2221</span>&#160;        vkDestroyPipeline(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a7c5bcd70166fdff0cfb40feec15e1a97">pipeline</a>, NULL);</div><div class="line"><a name="l02222"></a><span class="lineno"> 2222</span>&#160;        vkDestroyPipelineCache(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a3fb491730f2e5101689e1be3ebc3eb21">pipelineCache</a>, NULL);</div><div class="line"><a name="l02223"></a><span class="lineno"> 2223</span>&#160;        vkDestroyRenderPass(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a759be060753e7516d58c97f59af390ff">render_pass</a>, NULL);</div><div class="line"><a name="l02224"></a><span class="lineno"> 2224</span>&#160;        vkDestroyPipelineLayout(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a1f9db6e3c3b5edf52eda4d2d95ad9a42">pipeline_layout</a>, NULL);</div><div class="line"><a name="l02225"></a><span class="lineno"> 2225</span>&#160;        vkDestroyDescriptorSetLayout(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a2bdc8b6c1791c08c4b6ad61873b30155">desc_layout</a>, NULL);</div><div class="line"><a name="l02226"></a><span class="lineno"> 2226</span>&#160;</div><div class="line"><a name="l02227"></a><span class="lineno"> 2227</span>&#160;        <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code" href="cube_8c.html#a889c754b96e13c9a94c431b8c10b7153">DEMO_TEXTURE_COUNT</a>; i++) {</div><div class="line"><a name="l02228"></a><span class="lineno"> 2228</span>&#160;            vkDestroyImageView(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#acf536a91cb2f8b06b4d4ea1b818c8eb1">view</a>, NULL);</div><div class="line"><a name="l02229"></a><span class="lineno"> 2229</span>&#160;            vkDestroyImage(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a>, NULL);</div><div class="line"><a name="l02230"></a><span class="lineno"> 2230</span>&#160;            vkFreeMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#ab3ac82ddeb7e29bc9e2facbfa49f6673">mem</a>, NULL);</div><div class="line"><a name="l02231"></a><span class="lineno"> 2231</span>&#160;            vkDestroySampler(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#a3e54bffa65ec12e0bb5daa2dc4fb1efd">sampler</a>, NULL);</div><div class="line"><a name="l02232"></a><span class="lineno"> 2232</span>&#160;        }</div><div class="line"><a name="l02233"></a><span class="lineno"> 2233</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a08a1730bfb0fd09a5b4de50cf87c212d">fpDestroySwapchainKHR</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a29b10893f1569e17a99027963c2fed3b">swapchain</a>, NULL);</div><div class="line"><a name="l02234"></a><span class="lineno"> 2234</span>&#160;</div><div class="line"><a name="l02235"></a><span class="lineno"> 2235</span>&#160;        vkDestroyImageView(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a2acac138a169a49cb7ecb1e066249079">view</a>, NULL);</div><div class="line"><a name="l02236"></a><span class="lineno"> 2236</span>&#160;        vkDestroyImage(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a7b314d782d35c91b31bd7e810f42d2d3">image</a>, NULL);</div><div class="line"><a name="l02237"></a><span class="lineno"> 2237</span>&#160;        vkFreeMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a506c89485b5987ac326e4616e20d38d1">mem</a>, NULL);</div><div class="line"><a name="l02238"></a><span class="lineno"> 2238</span>&#160;</div><div class="line"><a name="l02239"></a><span class="lineno"> 2239</span>&#160;        <span class="keywordflow">for</span> (i = 0; i &lt; demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>; i++) {</div><div class="line"><a name="l02240"></a><span class="lineno"> 2240</span>&#160;            vkDestroyImageView(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a2fc87148f25f154eaeaf7dc2cdef135d">view</a>, NULL);</div><div class="line"><a name="l02241"></a><span class="lineno"> 2241</span>&#160;            vkFreeCommandBuffers(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#af527d51e6fafb65fec23e3b95b622b93">cmd_pool</a>, 1, &amp;demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a01f3d0317c7802a763e58e9817b7f3c2">cmd</a>);</div><div class="line"><a name="l02242"></a><span class="lineno"> 2242</span>&#160;            vkDestroyBuffer(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a73375235ed97731ad09a1400d9a50d63">uniform_buffer</a>, NULL);</div><div class="line"><a name="l02243"></a><span class="lineno"> 2243</span>&#160;            vkFreeMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a2e342d29ed730c31f00de806b8bfb4b2">uniform_memory</a>, NULL);</div><div class="line"><a name="l02244"></a><span class="lineno"> 2244</span>&#160;        }</div><div class="line"><a name="l02245"></a><span class="lineno"> 2245</span>&#160;        free(demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>);</div><div class="line"><a name="l02246"></a><span class="lineno"> 2246</span>&#160;        free(demo-&gt;<a class="code" href="structdemo.html#ad1d805df20add2d34e6f9a5d9e2f7fd9">queue_props</a>);</div><div class="line"><a name="l02247"></a><span class="lineno"> 2247</span>&#160;        vkDestroyCommandPool(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#af527d51e6fafb65fec23e3b95b622b93">cmd_pool</a>, NULL);</div><div class="line"><a name="l02248"></a><span class="lineno"> 2248</span>&#160;</div><div class="line"><a name="l02249"></a><span class="lineno"> 2249</span>&#160;        <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">separate_present_queue</a>) {</div><div class="line"><a name="l02250"></a><span class="lineno"> 2250</span>&#160;            vkDestroyCommandPool(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#acc57b4fdd35d5caf270586100354ba6c">present_cmd_pool</a>, NULL);</div><div class="line"><a name="l02251"></a><span class="lineno"> 2251</span>&#160;        }</div><div class="line"><a name="l02252"></a><span class="lineno"> 2252</span>&#160;    }</div><div class="line"><a name="l02253"></a><span class="lineno"> 2253</span>&#160;    vkDeviceWaitIdle(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>);</div><div class="line"><a name="l02254"></a><span class="lineno"> 2254</span>&#160;    vkDestroyDevice(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, NULL);</div><div class="line"><a name="l02255"></a><span class="lineno"> 2255</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">validate</a>) {</div><div class="line"><a name="l02256"></a><span class="lineno"> 2256</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#adcae8daa6e7a30ad72ff6af6207e4add">DestroyDebugUtilsMessengerEXT</a>(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, demo-&gt;<a class="code" href="structdemo.html#ab35e8474d7bb46e41e1fa0a07593c977">dbg_messenger</a>, NULL);</div><div class="line"><a name="l02257"></a><span class="lineno"> 2257</span>&#160;    }</div><div class="line"><a name="l02258"></a><span class="lineno"> 2258</span>&#160;    vkDestroySurfaceKHR(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, demo-&gt;<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a>, NULL);</div><div class="line"><a name="l02259"></a><span class="lineno"> 2259</span>&#160;</div><div class="line"><a name="l02260"></a><span class="lineno"> 2260</span>&#160;<span class="preprocessor">#if defined(VK_USE_PLATFORM_XLIB_KHR)</span></div><div class="line"><a name="l02261"></a><span class="lineno"> 2261</span>&#160;    XDestroyWindow(demo-&gt;display, demo-&gt;xlib_window);</div><div class="line"><a name="l02262"></a><span class="lineno"> 2262</span>&#160;    XCloseDisplay(demo-&gt;display);</div><div class="line"><a name="l02263"></a><span class="lineno"> 2263</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_XCB_KHR)</span></div><div class="line"><a name="l02264"></a><span class="lineno"> 2264</span>&#160;    xcb_destroy_window(demo-&gt;<a class="code" href="structdemo.html#a4f271161fb166d561f5da630dd0de222">connection</a>, demo-&gt;xcb_window);</div><div class="line"><a name="l02265"></a><span class="lineno"> 2265</span>&#160;    xcb_disconnect(demo-&gt;<a class="code" href="structdemo.html#a4f271161fb166d561f5da630dd0de222">connection</a>);</div><div class="line"><a name="l02266"></a><span class="lineno"> 2266</span>&#160;    free(demo-&gt;atom_wm_delete_window);</div><div class="line"><a name="l02267"></a><span class="lineno"> 2267</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)</span></div><div class="line"><a name="l02268"></a><span class="lineno"> 2268</span>&#160;    wl_keyboard_destroy(demo-&gt;keyboard);</div><div class="line"><a name="l02269"></a><span class="lineno"> 2269</span>&#160;    wl_pointer_destroy(demo-&gt;pointer);</div><div class="line"><a name="l02270"></a><span class="lineno"> 2270</span>&#160;    wl_seat_destroy(demo-&gt;seat);</div><div class="line"><a name="l02271"></a><span class="lineno"> 2271</span>&#160;    wl_shell_surface_destroy(demo-&gt;shell_surface);</div><div class="line"><a name="l02272"></a><span class="lineno"> 2272</span>&#160;    wl_surface_destroy(demo-&gt;<a class="code" href="structdemo.html#a096ec114abccb153f4043e8b1c75be22">window</a>);</div><div class="line"><a name="l02273"></a><span class="lineno"> 2273</span>&#160;    wl_shell_destroy(demo-&gt;shell);</div><div class="line"><a name="l02274"></a><span class="lineno"> 2274</span>&#160;    wl_compositor_destroy(demo-&gt;compositor);</div><div class="line"><a name="l02275"></a><span class="lineno"> 2275</span>&#160;    wl_registry_destroy(demo-&gt;registry);</div><div class="line"><a name="l02276"></a><span class="lineno"> 2276</span>&#160;    wl_display_disconnect(demo-&gt;display);</div><div class="line"><a name="l02277"></a><span class="lineno"> 2277</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_MIR_KHR)</span></div><div class="line"><a name="l02278"></a><span class="lineno"> 2278</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l02279"></a><span class="lineno"> 2279</span>&#160;</div><div class="line"><a name="l02280"></a><span class="lineno"> 2280</span>&#160;    vkDestroyInstance(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, NULL);</div><div class="line"><a name="l02281"></a><span class="lineno"> 2281</span>&#160;}</div><div class="ttc" id="structdemo_html_a37de313a90cfadb40755d35e8d70f704"><div class="ttname"><a href="structdemo.html#a37de313a90cfadb40755d35e8d70f704">demo::prepared</a></div><div class="ttdeci">bool prepared</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00339">cube.c:339</a></div></div>
<div class="ttc" id="structdemo_html_a337380c3a804d2cb24e6ce3a5ecc80e5"><div class="ttname"><a href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">demo::swapchainImageCount</a></div><div class="ttdeci">uint32_t swapchainImageCount</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00390">cube.c:390</a></div></div>
<div class="ttc" id="structdemo_html_a29b10893f1569e17a99027963c2fed3b"><div class="ttname"><a href="structdemo.html#a29b10893f1569e17a99027963c2fed3b">demo::swapchain</a></div><div class="ttdeci">VkSwapchainKHR swapchain</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00391">cube.c:391</a></div></div>
<div class="ttc" id="structdemo_html_a7c5bcd70166fdff0cfb40feec15e1a97"><div class="ttname"><a href="structdemo.html#a7c5bcd70166fdff0cfb40feec15e1a97">demo::pipeline</a></div><div class="ttdeci">VkPipeline pipeline</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00417">cube.c:417</a></div></div>
<div class="ttc" id="structdemo_html_a506c89485b5987ac326e4616e20d38d1"><div class="ttname"><a href="structdemo.html#a506c89485b5987ac326e4616e20d38d1">demo::mem</a></div><div class="ttdeci">VkDeviceMemory mem</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00405">cube.c:405</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a2fc87148f25f154eaeaf7dc2cdef135d"><div class="ttname"><a href="struct_swapchain_image_resources.html#a2fc87148f25f154eaeaf7dc2cdef135d">SwapchainImageResources::view</a></div><div class="ttdeci">VkImageView view</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00298">cube.c:298</a></div></div>
<div class="ttc" id="structdemo_html_aee60ae051d1ee577f267ecc3b8da36ef"><div class="ttname"><a href="structdemo.html#aee60ae051d1ee577f267ecc3b8da36ef">demo::fences</a></div><div class="ttdeci">VkFence fences[FRAME_LAG]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00394">cube.c:394</a></div></div>
<div class="ttc" id="cube_8c_html_a44a58ed35161ff13de8fbf41f913a729"><div class="ttname"><a href="cube_8c.html#a44a58ed35161ff13de8fbf41f913a729">FRAME_LAG</a></div><div class="ttdeci">#define FRAME_LAG</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00071">cube.c:71</a></div></div>
<div class="ttc" id="structdemo_html_a2bba0ce9e5e1866670c37cec1ed784c5"><div class="ttname"><a href="structdemo.html#a2bba0ce9e5e1866670c37cec1ed784c5">demo::image_ownership_semaphores</a></div><div class="ttdeci">VkSemaphore image_ownership_semaphores[FRAME_LAG]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00365">cube.c:365</a></div></div>
<div class="ttc" id="structdemo_html_ae0d984aad2f9eb0779c6ec09df17d183"><div class="ttname"><a href="structdemo.html#ae0d984aad2f9eb0779c6ec09df17d183">demo::image_acquired_semaphores</a></div><div class="ttdeci">VkSemaphore image_acquired_semaphores[FRAME_LAG]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00363">cube.c:363</a></div></div>
<div class="ttc" id="structtexture__object_html_a3e54bffa65ec12e0bb5daa2dc4fb1efd"><div class="ttname"><a href="structtexture__object.html#a3e54bffa65ec12e0bb5daa2dc4fb1efd">texture_object::sampler</a></div><div class="ttdeci">VkSampler sampler</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00161">cube.c:161</a></div></div>
<div class="ttc" id="structdemo_html_ab35e8474d7bb46e41e1fa0a07593c977"><div class="ttname"><a href="structdemo.html#ab35e8474d7bb46e41e1fa0a07593c977">demo::dbg_messenger</a></div><div class="ttdeci">VkDebugUtilsMessengerEXT dbg_messenger</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00447">cube.c:447</a></div></div>
<div class="ttc" id="structdemo_html_af527d51e6fafb65fec23e3b95b622b93"><div class="ttname"><a href="structdemo.html#af527d51e6fafb65fec23e3b95b622b93">demo::cmd_pool</a></div><div class="ttdeci">VkCommandPool cmd_pool</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00397">cube.c:397</a></div></div>
<div class="ttc" id="cube_8c_html_a889c754b96e13c9a94c431b8c10b7153"><div class="ttname"><a href="cube_8c.html#a889c754b96e13c9a94c431b8c10b7153">DEMO_TEXTURE_COUNT</a></div><div class="ttdeci">#define DEMO_TEXTURE_COUNT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00066">cube.c:66</a></div></div>
<div class="ttc" id="structdemo_html_a139cab94cb0a578562759d7f315ca0b5"><div class="ttname"><a href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">demo::swapchain_image_resources</a></div><div class="ttdeci">SwapchainImageResources * swapchain_image_resources</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00392">cube.c:392</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a2e342d29ed730c31f00de806b8bfb4b2"><div class="ttname"><a href="struct_swapchain_image_resources.html#a2e342d29ed730c31f00de806b8bfb4b2">SwapchainImageResources::uniform_memory</a></div><div class="ttdeci">VkDeviceMemory uniform_memory</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00300">cube.c:300</a></div></div>
<div class="ttc" id="structdemo_html_a872713baccf01389616f3bf7c2358ea0"><div class="ttname"><a href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">demo::depth</a></div><div class="ttdeci">struct demo::@0 depth</div></div>
<div class="ttc" id="structdemo_html_ab86850eb961f077b1c65bbfa50f4111e"><div class="ttname"><a href="structdemo.html#ab86850eb961f077b1c65bbfa50f4111e">demo::draw_complete_semaphores</a></div><div class="ttdeci">VkSemaphore draw_complete_semaphores[FRAME_LAG]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00364">cube.c:364</a></div></div>
<div class="ttc" id="structdemo_html_a6295c3f9292dfc7484b71ef464cd1bda"><div class="ttname"><a href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">demo::surface</a></div><div class="ttdeci">VkSurfaceKHR surface</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00338">cube.c:338</a></div></div>
<div class="ttc" id="structdemo_html_ad1d805df20add2d34e6f9a5d9e2f7fd9"><div class="ttname"><a href="structdemo.html#ad1d805df20add2d34e6f9a5d9e2f7fd9">demo::queue_props</a></div><div class="ttdeci">VkQueueFamilyProperties * queue_props</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00367">cube.c:367</a></div></div>
<div class="ttc" id="structdemo_html_a2bdc8b6c1791c08c4b6ad61873b30155"><div class="ttname"><a href="structdemo.html#a2bdc8b6c1791c08c4b6ad61873b30155">demo::desc_layout</a></div><div class="ttdeci">VkDescriptorSetLayout desc_layout</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00414">cube.c:414</a></div></div>
<div class="ttc" id="structdemo_html_a08a1730bfb0fd09a5b4de50cf87c212d"><div class="ttname"><a href="structdemo.html#a08a1730bfb0fd09a5b4de50cf87c212d">demo::fpDestroySwapchainKHR</a></div><div class="ttdeci">PFN_vkDestroySwapchainKHR fpDestroySwapchainKHR</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00384">cube.c:384</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a09729b546f1f1017e0052fd076299776"><div class="ttname"><a href="struct_swapchain_image_resources.html#a09729b546f1f1017e0052fd076299776">SwapchainImageResources::framebuffer</a></div><div class="ttdeci">VkFramebuffer framebuffer</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00301">cube.c:301</a></div></div>
<div class="ttc" id="structdemo_html_a4f271161fb166d561f5da630dd0de222"><div class="ttname"><a href="structdemo.html#a4f271161fb166d561f5da630dd0de222">demo::connection</a></div><div class="ttdeci">HINSTANCE connection</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00308">cube.c:308</a></div></div>
<div class="ttc" id="structdemo_html_ac2570a83ce706add3b8a07673237f30c"><div class="ttname"><a href="structdemo.html#ac2570a83ce706add3b8a07673237f30c">demo::is_minimized</a></div><div class="ttdeci">bool is_minimized</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00342">cube.c:342</a></div></div>
<div class="ttc" id="structdemo_html_acc57b4fdd35d5caf270586100354ba6c"><div class="ttname"><a href="structdemo.html#acc57b4fdd35d5caf270586100354ba6c">demo::present_cmd_pool</a></div><div class="ttdeci">VkCommandPool present_cmd_pool</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00398">cube.c:398</a></div></div>
<div class="ttc" id="structdemo_html_a2acac138a169a49cb7ecb1e066249079"><div class="ttname"><a href="structdemo.html#a2acac138a169a49cb7ecb1e066249079">demo::view</a></div><div class="ttdeci">VkImageView view</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00406">cube.c:406</a></div></div>
<div class="ttc" id="structdemo_html_a3fb491730f2e5101689e1be3ebc3eb21"><div class="ttname"><a href="structdemo.html#a3fb491730f2e5101689e1be3ebc3eb21">demo::pipelineCache</a></div><div class="ttdeci">VkPipelineCache pipelineCache</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00415">cube.c:415</a></div></div>
<div class="ttc" id="structdemo_html_a1f9db6e3c3b5edf52eda4d2d95ad9a42"><div class="ttname"><a href="structdemo.html#a1f9db6e3c3b5edf52eda4d2d95ad9a42">demo::pipeline_layout</a></div><div class="ttdeci">VkPipelineLayout pipeline_layout</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00413">cube.c:413</a></div></div>
<div class="ttc" id="structdemo_html_a20263af0f46296860c8053ee113fa9f8"><div class="ttname"><a href="structdemo.html#a20263af0f46296860c8053ee113fa9f8">demo::desc_pool</a></div><div class="ttdeci">VkDescriptorPool desc_pool</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00430">cube.c:430</a></div></div>
<div class="ttc" id="structtexture__object_html_ab3ac82ddeb7e29bc9e2facbfa49f6673"><div class="ttname"><a href="structtexture__object.html#ab3ac82ddeb7e29bc9e2facbfa49f6673">texture_object::mem</a></div><div class="ttdeci">VkDeviceMemory mem</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00167">cube.c:167</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a01f3d0317c7802a763e58e9817b7f3c2"><div class="ttname"><a href="struct_swapchain_image_resources.html#a01f3d0317c7802a763e58e9817b7f3c2">SwapchainImageResources::cmd</a></div><div class="ttdeci">VkCommandBuffer cmd</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00296">cube.c:296</a></div></div>
<div class="ttc" id="structdemo_html_a069de0b6f83a6c8af47b14dc76e52ee5"><div class="ttname"><a href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">demo::textures</a></div><div class="ttdeci">struct texture_object textures[DEMO_TEXTURE_COUNT]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00409">cube.c:409</a></div></div>
<div class="ttc" id="structtexture__object_html_acf536a91cb2f8b06b4d4ea1b818c8eb1"><div class="ttname"><a href="structtexture__object.html#acf536a91cb2f8b06b4d4ea1b818c8eb1">texture_object::view</a></div><div class="ttdeci">VkImageView view</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00168">cube.c:168</a></div></div>
<div class="ttc" id="structdemo_html_a7b314d782d35c91b31bd7e810f42d2d3"><div class="ttname"><a href="structdemo.html#a7b314d782d35c91b31bd7e810f42d2d3">demo::image</a></div><div class="ttdeci">VkImage image</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00403">cube.c:403</a></div></div>
<div class="ttc" id="structdemo_html_a894fb54cff1b88236c70332f35c40e04"><div class="ttname"><a href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">demo::separate_present_queue</a></div><div class="ttdeci">bool separate_present_queue</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00341">cube.c:341</a></div></div>
<div class="ttc" id="structdemo_html_a3042e9d9a2afa521340ebb55b09e93ef"><div class="ttname"><a href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">demo::validate</a></div><div class="ttdeci">bool validate</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00435">cube.c:435</a></div></div>
<div class="ttc" id="structdemo_html_adcae8daa6e7a30ad72ff6af6207e4add"><div class="ttname"><a href="structdemo.html#adcae8daa6e7a30ad72ff6af6207e4add">demo::DestroyDebugUtilsMessengerEXT</a></div><div class="ttdeci">PFN_vkDestroyDebugUtilsMessengerEXT DestroyDebugUtilsMessengerEXT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00441">cube.c:441</a></div></div>
<div class="ttc" id="structdemo_html_ad5052f1e07e9c04deaa9a1f8e4e13654"><div class="ttname"><a href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">demo::inst</a></div><div class="ttdeci">VkInstance inst</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00356">cube.c:356</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a73375235ed97731ad09a1400d9a50d63"><div class="ttname"><a href="struct_swapchain_image_resources.html#a73375235ed97731ad09a1400d9a50d63">SwapchainImageResources::uniform_buffer</a></div><div class="ttdeci">VkBuffer uniform_buffer</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00299">cube.c:299</a></div></div>
<div class="ttc" id="structtexture__object_html_abffe0a242253611e95ee13d9c112e01c"><div class="ttname"><a href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">texture_object::image</a></div><div class="ttdeci">VkImage image</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00163">cube.c:163</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
<div class="ttc" id="structdemo_html_a096ec114abccb153f4043e8b1c75be22"><div class="ttname"><a href="structdemo.html#a096ec114abccb153f4043e8b1c75be22">demo::window</a></div><div class="ttdeci">HWND window</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00310">cube.c:310</a></div></div>
<div class="ttc" id="structdemo_html_a759be060753e7516d58c97f59af390ff"><div class="ttname"><a href="structdemo.html#a759be060753e7516d58c97f59af390ff">demo::render_pass</a></div><div class="ttdeci">VkRenderPass render_pass</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00416">cube.c:416</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ae1040d749c8bf35f9b48f04879e65928_icgraph.png" border="0" usemap="#cube_8c_ae1040d749c8bf35f9b48f04879e65928_icgraph" alt=""/></div>
<map name="cube_8c_ae1040d749c8bf35f9b48f04879e65928_icgraph" id="cube_8c_ae1040d749c8bf35f9b48f04879e65928_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="160,5,233,32"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ac570d41514a55546127adf73c8faef66"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_create_device </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l03243">3243</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00370">demo::enabled_extension_count</a>, <a class="el" href="cube_8c_source.html#l00372">demo::extension_names</a>, <a class="el" href="cube_8c_source.html#l00357">demo::gpu</a>, <a class="el" href="cube_8c_source.html#l00361">demo::graphics_queue_family_index</a>, <a class="el" href="cube_8c_source.html#l00362">demo::present_queue_family_index</a>, <a class="el" href="cube_8c_source.html#l00341">demo::separate_present_queue</a>, and <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l03278">demo_init_vk_swapchain()</a>.</p>
<div class="fragment"><div class="line"><a name="l03243"></a><span class="lineno"> 3243</span>&#160;                                                  {</div><div class="line"><a name="l03244"></a><span class="lineno"> 3244</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l03245"></a><span class="lineno"> 3245</span>&#160;    <span class="keywordtype">float</span> queue_priorities[1] = {0.0};</div><div class="line"><a name="l03246"></a><span class="lineno"> 3246</span>&#160;    VkDeviceQueueCreateInfo queues[2];</div><div class="line"><a name="l03247"></a><span class="lineno"> 3247</span>&#160;    queues[0].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;</div><div class="line"><a name="l03248"></a><span class="lineno"> 3248</span>&#160;    queues[0].pNext = NULL;</div><div class="line"><a name="l03249"></a><span class="lineno"> 3249</span>&#160;    queues[0].queueFamilyIndex = demo-&gt;<a class="code" href="structdemo.html#a9f7e94f1331e93955bcfdfb6596fedc1">graphics_queue_family_index</a>;</div><div class="line"><a name="l03250"></a><span class="lineno"> 3250</span>&#160;    queues[0].queueCount = 1;</div><div class="line"><a name="l03251"></a><span class="lineno"> 3251</span>&#160;    queues[0].pQueuePriorities = queue_priorities;</div><div class="line"><a name="l03252"></a><span class="lineno"> 3252</span>&#160;    queues[0].flags = 0;</div><div class="line"><a name="l03253"></a><span class="lineno"> 3253</span>&#160;</div><div class="line"><a name="l03254"></a><span class="lineno"> 3254</span>&#160;    VkDeviceCreateInfo <a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a> = {</div><div class="line"><a name="l03255"></a><span class="lineno"> 3255</span>&#160;        .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,</div><div class="line"><a name="l03256"></a><span class="lineno"> 3256</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l03257"></a><span class="lineno"> 3257</span>&#160;        .queueCreateInfoCount = 1,</div><div class="line"><a name="l03258"></a><span class="lineno"> 3258</span>&#160;        .pQueueCreateInfos = queues,</div><div class="line"><a name="l03259"></a><span class="lineno"> 3259</span>&#160;        .enabledLayerCount = 0,</div><div class="line"><a name="l03260"></a><span class="lineno"> 3260</span>&#160;        .ppEnabledLayerNames = NULL,</div><div class="line"><a name="l03261"></a><span class="lineno"> 3261</span>&#160;        .enabledExtensionCount = demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a>,</div><div class="line"><a name="l03262"></a><span class="lineno"> 3262</span>&#160;        .ppEnabledExtensionNames = (<span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> *)demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>,</div><div class="line"><a name="l03263"></a><span class="lineno"> 3263</span>&#160;        .pEnabledFeatures = NULL,  <span class="comment">// If specific features are required, pass them in here</span></div><div class="line"><a name="l03264"></a><span class="lineno"> 3264</span>&#160;    };</div><div class="line"><a name="l03265"></a><span class="lineno"> 3265</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">separate_present_queue</a>) {</div><div class="line"><a name="l03266"></a><span class="lineno"> 3266</span>&#160;        queues[1].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;</div><div class="line"><a name="l03267"></a><span class="lineno"> 3267</span>&#160;        queues[1].pNext = NULL;</div><div class="line"><a name="l03268"></a><span class="lineno"> 3268</span>&#160;        queues[1].queueFamilyIndex = demo-&gt;<a class="code" href="structdemo.html#a8e9f41863731d6ab805b8d632f3d0c9d">present_queue_family_index</a>;</div><div class="line"><a name="l03269"></a><span class="lineno"> 3269</span>&#160;        queues[1].queueCount = 1;</div><div class="line"><a name="l03270"></a><span class="lineno"> 3270</span>&#160;        queues[1].pQueuePriorities = queue_priorities;</div><div class="line"><a name="l03271"></a><span class="lineno"> 3271</span>&#160;        queues[1].flags = 0;</div><div class="line"><a name="l03272"></a><span class="lineno"> 3272</span>&#160;        device.queueCreateInfoCount = 2;</div><div class="line"><a name="l03273"></a><span class="lineno"> 3273</span>&#160;    }</div><div class="line"><a name="l03274"></a><span class="lineno"> 3274</span>&#160;    err = vkCreateDevice(demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a>, &amp;device, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>);</div><div class="line"><a name="l03275"></a><span class="lineno"> 3275</span>&#160;    assert(!err);</div><div class="line"><a name="l03276"></a><span class="lineno"> 3276</span>&#160;}</div><div class="ttc" id="structdemo_html_a8e9f41863731d6ab805b8d632f3d0c9d"><div class="ttname"><a href="structdemo.html#a8e9f41863731d6ab805b8d632f3d0c9d">demo::present_queue_family_index</a></div><div class="ttdeci">uint32_t present_queue_family_index</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00362">cube.c:362</a></div></div>
<div class="ttc" id="structdemo_html_a9c6557c8003a1e6f5646fcf368175de7"><div class="ttname"><a href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">demo::enabled_extension_count</a></div><div class="ttdeci">uint32_t enabled_extension_count</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00370">cube.c:370</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_a8a273601d837eaa47c58ff52cffad7e2"><div class="ttname"><a href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">demo::extension_names</a></div><div class="ttdeci">char * extension_names[64]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00372">cube.c:372</a></div></div>
<div class="ttc" id="structdemo_html_a9f7e94f1331e93955bcfdfb6596fedc1"><div class="ttname"><a href="structdemo.html#a9f7e94f1331e93955bcfdfb6596fedc1">demo::graphics_queue_family_index</a></div><div class="ttdeci">uint32_t graphics_queue_family_index</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00361">cube.c:361</a></div></div>
<div class="ttc" id="structdemo_html_a1238f2cb459a1255d322dd141f2f4adb"><div class="ttname"><a href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">demo::gpu</a></div><div class="ttdeci">VkPhysicalDevice gpu</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00357">cube.c:357</a></div></div>
<div class="ttc" id="structdemo_html_a894fb54cff1b88236c70332f35c40e04"><div class="ttname"><a href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">demo::separate_present_queue</a></div><div class="ttdeci">bool separate_present_queue</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00341">cube.c:341</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ac570d41514a55546127adf73c8faef66_icgraph.png" border="0" usemap="#cube_8c_ac570d41514a55546127adf73c8faef66_icgraph" alt=""/></div>
<map name="cube_8c_ac570d41514a55546127adf73c8faef66_icgraph" id="cube_8c_ac570d41514a55546127adf73c8faef66_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#ab8af4815cac383b0436928fe474b98b3" title="demo_init_vk_swapchain" alt="" coords="193,5,359,32"/>
<area shape="rect" id="node3" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="407,5,480,32"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a3553c2367998ea3c060aa8f3d64ed155"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_create_window </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l02387">2387</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00067">APP_SHORT_NAME</a>, <a class="el" href="cube_8c_source.html#l00308">demo::connection</a>, <a class="el" href="cube_8c_source.html#l00433">demo::curFrame</a>, <a class="el" href="cube_8c_source.html#l01003">demo_draw()</a>, <a class="el" href="cube_8c_source.html#l02283">demo_resize()</a>, <a class="el" href="cube_8c_source.html#l02344">demo_run()</a>, <a class="el" href="cube_8c_source.html#l00434">demo::frameCount</a>, <a class="el" href="cube_8c_source.html#l00357">demo::gpu</a>, <a class="el" href="cube_8c_source.html#l00375">demo::height</a>, <a class="el" href="cube_8c_source.html#l00356">demo::inst</a>, <a class="el" href="cube_8c_source.html#l00311">demo::minsize</a>, <a class="el" href="cube_8c_source.html#l00309">demo::name</a>, <a class="el" href="cube_8c_source.html#l00425">demo::pause</a>, <a class="el" href="cube_8c_source.html#l00339">demo::prepared</a>, <a class="el" href="cube_8c_source.html#l00432">demo::quit</a>, <a class="el" href="cube_8c_source.html#l00423">demo::spin_angle</a>, <a class="el" href="cube_8c_source.html#l00424">demo::spin_increment</a>, <a class="el" href="cube_8c_source.html#l00338">demo::surface</a>, <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>, <a class="el" href="cube_8c_source.html#l00084">UNUSED</a>, <a class="el" href="cube_8c_source.html#l00375">demo::width</a>, <a class="el" href="cube_8c_source.html#l00310">demo::window</a>, and <a class="el" href="cube_8c_source.html#l02355">WndProc()</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l03702">WinMain()</a>.</p>
<div class="fragment"><div class="line"><a name="l02387"></a><span class="lineno"> 2387</span>&#160;                                                  {</div><div class="line"><a name="l02388"></a><span class="lineno"> 2388</span>&#160;    WNDCLASSEX win_class;</div><div class="line"><a name="l02389"></a><span class="lineno"> 2389</span>&#160;</div><div class="line"><a name="l02390"></a><span class="lineno"> 2390</span>&#160;    <span class="comment">// Initialize the window class structure:</span></div><div class="line"><a name="l02391"></a><span class="lineno"> 2391</span>&#160;    win_class.cbSize = <span class="keyword">sizeof</span>(WNDCLASSEX);</div><div class="line"><a name="l02392"></a><span class="lineno"> 2392</span>&#160;    win_class.style = CS_HREDRAW | CS_VREDRAW;</div><div class="line"><a name="l02393"></a><span class="lineno"> 2393</span>&#160;    win_class.lpfnWndProc = <a class="code" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95">WndProc</a>;</div><div class="line"><a name="l02394"></a><span class="lineno"> 2394</span>&#160;    win_class.cbClsExtra = 0;</div><div class="line"><a name="l02395"></a><span class="lineno"> 2395</span>&#160;    win_class.cbWndExtra = 0;</div><div class="line"><a name="l02396"></a><span class="lineno"> 2396</span>&#160;    win_class.hInstance = demo-&gt;<a class="code" href="structdemo.html#a4f271161fb166d561f5da630dd0de222">connection</a>;  <span class="comment">// hInstance</span></div><div class="line"><a name="l02397"></a><span class="lineno"> 2397</span>&#160;    win_class.hIcon = LoadIcon(NULL, IDI_APPLICATION);</div><div class="line"><a name="l02398"></a><span class="lineno"> 2398</span>&#160;    win_class.hCursor = LoadCursor(NULL, IDC_ARROW);</div><div class="line"><a name="l02399"></a><span class="lineno"> 2399</span>&#160;    win_class.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);</div><div class="line"><a name="l02400"></a><span class="lineno"> 2400</span>&#160;    win_class.lpszMenuName = NULL;</div><div class="line"><a name="l02401"></a><span class="lineno"> 2401</span>&#160;    win_class.lpszClassName = demo-&gt;<a class="code" href="structdemo.html#abcd428d42a8168aba23e333113803a23">name</a>;</div><div class="line"><a name="l02402"></a><span class="lineno"> 2402</span>&#160;    win_class.hIconSm = LoadIcon(NULL, IDI_WINLOGO);</div><div class="line"><a name="l02403"></a><span class="lineno"> 2403</span>&#160;    <span class="comment">// Register window class:</span></div><div class="line"><a name="l02404"></a><span class="lineno"> 2404</span>&#160;    <span class="keywordflow">if</span> (!RegisterClassEx(&amp;win_class)) {</div><div class="line"><a name="l02405"></a><span class="lineno"> 2405</span>&#160;        <span class="comment">// It didn&#39;t work, so try to give a useful error:</span></div><div class="line"><a name="l02406"></a><span class="lineno"> 2406</span>&#160;        printf(<span class="stringliteral">&quot;Unexpected error trying to start the application!\n&quot;</span>);</div><div class="line"><a name="l02407"></a><span class="lineno"> 2407</span>&#160;        fflush(stdout);</div><div class="line"><a name="l02408"></a><span class="lineno"> 2408</span>&#160;        exit(1);</div><div class="line"><a name="l02409"></a><span class="lineno"> 2409</span>&#160;    }</div><div class="line"><a name="l02410"></a><span class="lineno"> 2410</span>&#160;    <span class="comment">// Create window with the registered class:</span></div><div class="line"><a name="l02411"></a><span class="lineno"> 2411</span>&#160;    RECT wr = {0, 0, demo-&gt;<a class="code" href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">width</a>, demo-&gt;<a class="code" href="structdemo.html#a471d07293ae638531f808771c9975c07">height</a>};</div><div class="line"><a name="l02412"></a><span class="lineno"> 2412</span>&#160;    AdjustWindowRect(&amp;wr, WS_OVERLAPPEDWINDOW, FALSE);</div><div class="line"><a name="l02413"></a><span class="lineno"> 2413</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a096ec114abccb153f4043e8b1c75be22">window</a> = CreateWindowEx(0,</div><div class="line"><a name="l02414"></a><span class="lineno"> 2414</span>&#160;                                  demo-&gt;<a class="code" href="structdemo.html#abcd428d42a8168aba23e333113803a23">name</a>,            <span class="comment">// class name</span></div><div class="line"><a name="l02415"></a><span class="lineno"> 2415</span>&#160;                                  demo-&gt;<a class="code" href="structdemo.html#abcd428d42a8168aba23e333113803a23">name</a>,            <span class="comment">// app name</span></div><div class="line"><a name="l02416"></a><span class="lineno"> 2416</span>&#160;                                  WS_OVERLAPPEDWINDOW |  <span class="comment">// window style</span></div><div class="line"><a name="l02417"></a><span class="lineno"> 2417</span>&#160;                                      WS_VISIBLE | WS_SYSMENU,</div><div class="line"><a name="l02418"></a><span class="lineno"> 2418</span>&#160;                                  100, 100,            <span class="comment">// x/y coords</span></div><div class="line"><a name="l02419"></a><span class="lineno"> 2419</span>&#160;                                  wr.right - wr.left,  <span class="comment">// width</span></div><div class="line"><a name="l02420"></a><span class="lineno"> 2420</span>&#160;                                  wr.bottom - wr.top,  <span class="comment">// height</span></div><div class="line"><a name="l02421"></a><span class="lineno"> 2421</span>&#160;                                  NULL,                <span class="comment">// handle to parent</span></div><div class="line"><a name="l02422"></a><span class="lineno"> 2422</span>&#160;                                  NULL,                <span class="comment">// handle to menu</span></div><div class="line"><a name="l02423"></a><span class="lineno"> 2423</span>&#160;                                  demo-&gt;<a class="code" href="structdemo.html#a4f271161fb166d561f5da630dd0de222">connection</a>,    <span class="comment">// hInstance</span></div><div class="line"><a name="l02424"></a><span class="lineno"> 2424</span>&#160;                                  NULL);               <span class="comment">// no extra parameters</span></div><div class="line"><a name="l02425"></a><span class="lineno"> 2425</span>&#160;    <span class="keywordflow">if</span> (!demo-&gt;<a class="code" href="structdemo.html#a096ec114abccb153f4043e8b1c75be22">window</a>) {</div><div class="line"><a name="l02426"></a><span class="lineno"> 2426</span>&#160;        <span class="comment">// It didn&#39;t work, so try to give a useful error:</span></div><div class="line"><a name="l02427"></a><span class="lineno"> 2427</span>&#160;        printf(<span class="stringliteral">&quot;Cannot create a window in which to draw!\n&quot;</span>);</div><div class="line"><a name="l02428"></a><span class="lineno"> 2428</span>&#160;        fflush(stdout);</div><div class="line"><a name="l02429"></a><span class="lineno"> 2429</span>&#160;        exit(1);</div><div class="line"><a name="l02430"></a><span class="lineno"> 2430</span>&#160;    }</div><div class="line"><a name="l02431"></a><span class="lineno"> 2431</span>&#160;    <span class="comment">// Window client area size must be at least 1 pixel high, to prevent crash.</span></div><div class="line"><a name="l02432"></a><span class="lineno"> 2432</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a7b4762aacfde2370774635836e7e6e8f">minsize</a>.x = GetSystemMetrics(SM_CXMINTRACK);</div><div class="line"><a name="l02433"></a><span class="lineno"> 2433</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a7b4762aacfde2370774635836e7e6e8f">minsize</a>.y = GetSystemMetrics(SM_CYMINTRACK) + 1;</div><div class="line"><a name="l02434"></a><span class="lineno"> 2434</span>&#160;}</div><div class="ttc" id="structdemo_html_a7b4762aacfde2370774635836e7e6e8f"><div class="ttname"><a href="structdemo.html#a7b4762aacfde2370774635836e7e6e8f">demo::minsize</a></div><div class="ttdeci">POINT minsize</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00311">cube.c:311</a></div></div>
<div class="ttc" id="structdemo_html_a471d07293ae638531f808771c9975c07"><div class="ttname"><a href="structdemo.html#a471d07293ae638531f808771c9975c07">demo::height</a></div><div class="ttdeci">int height</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="structdemo_html_a4f271161fb166d561f5da630dd0de222"><div class="ttname"><a href="structdemo.html#a4f271161fb166d561f5da630dd0de222">demo::connection</a></div><div class="ttdeci">HINSTANCE connection</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00308">cube.c:308</a></div></div>
<div class="ttc" id="structdemo_html_abcd428d42a8168aba23e333113803a23"><div class="ttname"><a href="structdemo.html#abcd428d42a8168aba23e333113803a23">demo::name</a></div><div class="ttdeci">char name[APP_NAME_STR_LEN]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00309">cube.c:309</a></div></div>
<div class="ttc" id="structdemo_html_a79020e20ddd6a4fe9bc9489a12d05696"><div class="ttname"><a href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">demo::width</a></div><div class="ttdeci">int width</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="structdemo_html_a096ec114abccb153f4043e8b1c75be22"><div class="ttname"><a href="structdemo.html#a096ec114abccb153f4043e8b1c75be22">demo::window</a></div><div class="ttdeci">HWND window</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00310">cube.c:310</a></div></div>
<div class="ttc" id="cube_8c_html_ae749e989b362e19783c7af4a2bf46c95"><div class="ttname"><a href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95">WndProc</a></div><div class="ttdeci">LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l02355">cube.c:2355</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a3553c2367998ea3c060aa8f3d64ed155_cgraph.png" border="0" usemap="#cube_8c_a3553c2367998ea3c060aa8f3d64ed155_cgraph" alt=""/></div>
<map name="cube_8c_a3553c2367998ea3c060aa8f3d64ed155_cgraph" id="cube_8c_a3553c2367998ea3c060aa8f3d64ed155_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="451,422,539,449"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="980,371,1076,398"/>
<area shape="rect" id="node30" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="324,371,403,398"/>
<area shape="rect" id="node31" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="200,321,276,347"/>
<area shape="rect" id="node26" href="cube_8c.html#a2967b050fc63b30dc0cf382fbcf8f3c6" title="demo_update_data_buffer" alt="" coords="587,371,757,398"/>
<area shape="rect" id="node27" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="595,422,749,449"/>
<area shape="rect" id="node4" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="1124,371,1228,398"/>
<area shape="rect" id="node5" href="cube_8c.html#a0c4cc92dc1a3456d6cca76e3187f2010" title="demo_prepare_buffers" alt="" coords="1315,22,1464,49"/>
<area shape="rect" id="node6" href="cube_8c.html#a3569c83afeb4ecc4d8d797af29ce89ed" title="demo_prepare_depth" alt="" coords="1565,189,1707,215"/>
<area shape="rect" id="node8" href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7" title="demo_prepare_textures" alt="" coords="1310,73,1469,99"/>
<area shape="rect" id="node12" href="cube_8c.html#a21da8dc23d75bc75b5dbe7dd01130739" title="demo_prepare_cube_data\l_buffers" alt="" coords="1551,123,1721,164"/>
<area shape="rect" id="node13" href="cube_8c.html#a36308c10e305d94d63e96fc82be78950" title="demo_prepare_descriptor\l_layout" alt="" coords="1305,229,1473,271"/>
<area shape="rect" id="node14" href="cube_8c.html#a4ac6098487e1fc2305847f666891cdec" title="demo_prepare_render_pass" alt="" coords="1298,295,1481,322"/>
<area shape="rect" id="node15" href="cube_8c.html#aa80cd8877b6b5d20217c451b207ca9d9" title="demo_prepare_pipeline" alt="" coords="1312,346,1467,373"/>
<area shape="rect" id="node19" href="cube_8c.html#ad1571a7e9407fa30327f858d07ea6702" title="demo_build_image_ownership_cmd" alt="" coords="1276,397,1503,423"/>
<area shape="rect" id="node20" href="cube_8c.html#a4ee7f5efc65c5972db015c6be8cda380" title="demo_prepare_descriptor_pool" alt="" coords="1290,447,1489,474"/>
<area shape="rect" id="node21" href="cube_8c.html#ac1957f225fabd1755a0064169fa5f6ba" title="demo_prepare_descriptor_set" alt="" coords="1293,498,1486,525"/>
<area shape="rect" id="node22" href="cube_8c.html#a3a72610dc44a370494307b568ef3abd6" title="demo_prepare_framebuffers" alt="" coords="1299,549,1480,575"/>
<area shape="rect" id="node23" href="cube_8c.html#aa9f275ddb85f8473f44c01a00ccfba63" title="demo_draw_build_cmd" alt="" coords="1312,599,1467,626"/>
<area shape="rect" id="node24" href="cube_8c.html#a7a35f4639d32b3ac59dd725668a363ba" title="demo_flush_init_cmd" alt="" coords="1317,650,1461,677"/>
<area shape="rect" id="node25" href="cube_8c.html#a10612fc5c33836b531554ee572b389f2" title="demo_destroy_texture\l_image" alt="" coords="1314,701,1465,743"/>
<area shape="rect" id="node7" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b" title="memory_type_from_properties" alt="" coords="1769,130,1967,157"/>
<area shape="rect" id="node9" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731" title="demo_prepare_texture\l_image" alt="" coords="1561,5,1711,47"/>
<area shape="rect" id="node11" href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8" title="demo_set_image_layout" alt="" coords="1555,71,1717,98"/>
<area shape="rect" id="node10" href="cube_8c.html#add4fd1e03edd51503c9c554e77a042fa" title="loadTexture" alt="" coords="1823,13,1913,39"/>
<area shape="rect" id="node16" href="cube_8c.html#ab1d134177a8964ce85593b229fc7f688" title="demo_prepare_vs" alt="" coords="1575,321,1697,347"/>
<area shape="rect" id="node18" href="cube_8c.html#ab89d9436b88fd3dea5de8cb03de51e94" title="demo_prepare_fs" alt="" coords="1575,371,1697,398"/>
<area shape="rect" id="node17" href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c" title="demo_prepare_shader\l_module" alt="" coords="1793,339,1943,380"/>
<area shape="rect" id="node28" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="805,422,932,449"/>
<area shape="rect" id="node29" href="cube_8c.html#ab9ca7a0a208ec589229116f2de6ee77c" title="ActualTimeLate" alt="" coords="813,371,925,398"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a3553c2367998ea3c060aa8f3d64ed155_icgraph.png" border="0" usemap="#cube_8c_a3553c2367998ea3c060aa8f3d64ed155_icgraph" alt=""/></div>
<map name="cube_8c_a3553c2367998ea3c060aa8f3d64ed155_icgraph" id="cube_8c_a3553c2367998ea3c060aa8f3d64ed155_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="200,5,273,32"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a10612fc5c33836b531554ee572b389f2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_destroy_texture_image </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structtexture__object.html">texture_object</a> *&#160;</td>
          <td class="paramname"><em>tex_objs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l01568">1568</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00163">texture_object::image</a>, and <a class="el" href="cube_8c_source.html#l00167">texture_object::mem</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>.</p>
<div class="fragment"><div class="line"><a name="l01568"></a><span class="lineno"> 1568</span>&#160;                                                                                           {</div><div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>&#160;    <span class="comment">/* clean up staging resources */</span></div><div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>&#160;    vkFreeMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, tex_objs-&gt;<a class="code" href="structtexture__object.html#ab3ac82ddeb7e29bc9e2facbfa49f6673">mem</a>, NULL);</div><div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>&#160;    vkDestroyImage(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, tex_objs-&gt;<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a>, NULL);</div><div class="line"><a name="l01572"></a><span class="lineno"> 1572</span>&#160;}</div><div class="ttc" id="structtexture__object_html_ab3ac82ddeb7e29bc9e2facbfa49f6673"><div class="ttname"><a href="structtexture__object.html#ab3ac82ddeb7e29bc9e2facbfa49f6673">texture_object::mem</a></div><div class="ttdeci">VkDeviceMemory mem</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00167">cube.c:167</a></div></div>
<div class="ttc" id="structtexture__object_html_abffe0a242253611e95ee13d9c112e01c"><div class="ttname"><a href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">texture_object::image</a></div><div class="ttdeci">VkImage image</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00163">cube.c:163</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a10612fc5c33836b531554ee572b389f2_icgraph.png" border="0" usemap="#cube_8c_a10612fc5c33836b531554ee572b389f2_icgraph" alt=""/></div>
<map name="cube_8c_a10612fc5c33836b531554ee572b389f2_icgraph" id="cube_8c_a10612fc5c33836b531554ee572b389f2_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="204,43,308,69"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="356,93,452,120"/>
<area shape="rect" id="node10" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1459,119,1532,145"/>
<area shape="rect" id="node4" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="500,144,627,171"/>
<area shape="rect" id="node6" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="877,119,965,145"/>
<area shape="rect" id="node8" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1140,245,1216,272"/>
<area shape="rect" id="node9" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1264,119,1411,145"/>
<area shape="rect" id="node5" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="675,144,829,171"/>
<area shape="rect" id="node7" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1013,156,1092,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a68587107d1c17fe6680e438488b9a616"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_draw </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l01003">1003</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00296">SwapchainImageResources::cmd</a>, <a class="el" href="cube_8c_source.html#l00449">demo::current_buffer</a>, <a class="el" href="cube_8c_source.html#l02283">demo_resize()</a>, <a class="el" href="cube_8c_source.html#l00865">demo_update_data_buffer()</a>, <a class="el" href="cube_8c_source.html#l00887">DemoUpdateTargetIPD()</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00364">demo::draw_complete_semaphores</a>, <a class="el" href="cube_8c_source.html#l00394">demo::fences</a>, <a class="el" href="cube_8c_source.html#l00386">demo::fpAcquireNextImageKHR</a>, <a class="el" href="cube_8c_source.html#l00387">demo::fpQueuePresentKHR</a>, <a class="el" href="cube_8c_source.html#l00395">demo::frame_index</a>, <a class="el" href="cube_8c_source.html#l00071">FRAME_LAG</a>, <a class="el" href="cube_8c_source.html#l00359">demo::graphics_queue</a>, <a class="el" href="cube_8c_source.html#l00297">SwapchainImageResources::graphics_to_present_cmd</a>, <a class="el" href="cube_8c_source.html#l00375">demo::height</a>, <a class="el" href="cube_8c_source.html#l00363">demo::image_acquired_semaphores</a>, <a class="el" href="cube_8c_source.html#l00365">demo::image_ownership_semaphores</a>, <a class="el" href="cube_8c_source.html#l00352">demo::next_present_id</a>, <a class="el" href="cube_8c_source.html#l00360">demo::present_queue</a>, <a class="el" href="cube_8c_source.html#l00351">demo::prev_desired_present_time</a>, <a class="el" href="cube_8c_source.html#l00341">demo::separate_present_queue</a>, <a class="el" href="cube_8c_source.html#l00391">demo::swapchain</a>, <a class="el" href="cube_8c_source.html#l00392">demo::swapchain_image_resources</a>, <a class="el" href="cube_8c_source.html#l00350">demo::target_IPD</a>, <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>, <a class="el" href="cube_8c_source.html#l00346">demo::VK_GOOGLE_display_timing_enabled</a>, <a class="el" href="cube_8c_source.html#l00344">demo::VK_KHR_incremental_present_enabled</a>, and <a class="el" href="cube_8c_source.html#l00375">demo::width</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02387">demo_create_window()</a>, and <a class="el" href="cube_8c_source.html#l02344">demo_run()</a>.</p>
<div class="fragment"><div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>&#160;                                         {</div><div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>&#160;</div><div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>&#160;    <span class="comment">// Ensure no more than FRAME_LAG renderings are outstanding</span></div><div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>&#160;    vkWaitForFences(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, 1, &amp;demo-&gt;<a class="code" href="structdemo.html#aee60ae051d1ee577f267ecc3b8da36ef">fences</a>[demo-&gt;<a class="code" href="structdemo.html#abbac641d0c27f49b126a4e08edd3e54f">frame_index</a>], VK_TRUE, UINT64_MAX);</div><div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>&#160;    vkResetFences(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, 1, &amp;demo-&gt;<a class="code" href="structdemo.html#aee60ae051d1ee577f267ecc3b8da36ef">fences</a>[demo-&gt;<a class="code" href="structdemo.html#abbac641d0c27f49b126a4e08edd3e54f">frame_index</a>]);</div><div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>&#160;</div><div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>&#160;    <span class="keywordflow">do</span> {</div><div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>&#160;        <span class="comment">// Get the index of the next available swapchain image:</span></div><div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>&#160;        err =</div><div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#aefb7c2f7c02ba26597ac9fcab061c465">fpAcquireNextImageKHR</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a29b10893f1569e17a99027963c2fed3b">swapchain</a>, UINT64_MAX,</div><div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>&#160;                                        demo-&gt;<a class="code" href="structdemo.html#ae0d984aad2f9eb0779c6ec09df17d183">image_acquired_semaphores</a>[demo-&gt;<a class="code" href="structdemo.html#abbac641d0c27f49b126a4e08edd3e54f">frame_index</a>], VK_NULL_HANDLE, &amp;demo-&gt;<a class="code" href="structdemo.html#a8ef0be14f77810d25d103241361daa30">current_buffer</a>);</div><div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>&#160;</div><div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>&#160;        <span class="keywordflow">if</span> (err == VK_ERROR_OUT_OF_DATE_KHR) {</div><div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>&#160;            <span class="comment">// demo-&gt;swapchain is out of date (e.g. the window was resized) and</span></div><div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>&#160;            <span class="comment">// must be recreated:</span></div><div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>&#160;            <a class="code" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a">demo_resize</a>(demo);</div><div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (err == VK_SUBOPTIMAL_KHR) {</div><div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>&#160;            <span class="comment">// demo-&gt;swapchain is not as optimal as it could be, but the platform&#39;s</span></div><div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>&#160;            <span class="comment">// presentation engine will still present the image correctly.</span></div><div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>&#160;        } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>&#160;            assert(!err);</div><div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>&#160;        }</div><div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>&#160;    } <span class="keywordflow">while</span> (err != VK_SUCCESS);</div><div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>&#160;</div><div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>&#160;    <a class="code" href="cube_8c.html#a2967b050fc63b30dc0cf382fbcf8f3c6">demo_update_data_buffer</a>(demo);</div><div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>&#160;</div><div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a31e84ca0ec847d04922fa8d1b9efacb7">VK_GOOGLE_display_timing_enabled</a>) {</div><div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>&#160;        <span class="comment">// Look at what happened to previous presents, and make appropriate</span></div><div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>&#160;        <span class="comment">// adjustments in timing:</span></div><div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>&#160;        <a class="code" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee">DemoUpdateTargetIPD</a>(demo);</div><div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>&#160;</div><div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>&#160;        <span class="comment">// Note: a real application would position its geometry to that it&#39;s in</span></div><div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>&#160;        <span class="comment">// the correct locatoin for when the next image is presented.  It might</span></div><div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>&#160;        <span class="comment">// also wait, so that there&#39;s less latency between any input and when</span></div><div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>&#160;        <span class="comment">// the next image is rendered/presented.  This demo program is so</span></div><div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>&#160;        <span class="comment">// simple that it doesn&#39;t do either of those.</span></div><div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>&#160;    }</div><div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>&#160;</div><div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>&#160;    <span class="comment">// Wait for the image acquired semaphore to be signaled to ensure</span></div><div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>&#160;    <span class="comment">// that the image won&#39;t be rendered to until the presentation</span></div><div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>&#160;    <span class="comment">// engine has fully released ownership to the application, and it is</span></div><div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>&#160;    <span class="comment">// okay to render to the image.</span></div><div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>&#160;    VkPipelineStageFlags pipe_stage_flags;</div><div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>&#160;    VkSubmitInfo submit_info;</div><div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>&#160;    submit_info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;</div><div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>&#160;    submit_info.pNext = NULL;</div><div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>&#160;    submit_info.pWaitDstStageMask = &amp;pipe_stage_flags;</div><div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>&#160;    pipe_stage_flags = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;</div><div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>&#160;    submit_info.waitSemaphoreCount = 1;</div><div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>&#160;    submit_info.pWaitSemaphores = &amp;demo-&gt;<a class="code" href="structdemo.html#ae0d984aad2f9eb0779c6ec09df17d183">image_acquired_semaphores</a>[demo-&gt;<a class="code" href="structdemo.html#abbac641d0c27f49b126a4e08edd3e54f">frame_index</a>];</div><div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>&#160;    submit_info.commandBufferCount = 1;</div><div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>&#160;    submit_info.pCommandBuffers = &amp;demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[demo-&gt;<a class="code" href="structdemo.html#a8ef0be14f77810d25d103241361daa30">current_buffer</a>].<a class="code" href="struct_swapchain_image_resources.html#a01f3d0317c7802a763e58e9817b7f3c2">cmd</a>;</div><div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>&#160;    submit_info.signalSemaphoreCount = 1;</div><div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>&#160;    submit_info.pSignalSemaphores = &amp;demo-&gt;<a class="code" href="structdemo.html#ab86850eb961f077b1c65bbfa50f4111e">draw_complete_semaphores</a>[demo-&gt;<a class="code" href="structdemo.html#abbac641d0c27f49b126a4e08edd3e54f">frame_index</a>];</div><div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>&#160;    err = vkQueueSubmit(demo-&gt;<a class="code" href="structdemo.html#abf27a3cd9fc6390bfb89202443aca026">graphics_queue</a>, 1, &amp;submit_info, demo-&gt;<a class="code" href="structdemo.html#aee60ae051d1ee577f267ecc3b8da36ef">fences</a>[demo-&gt;<a class="code" href="structdemo.html#abbac641d0c27f49b126a4e08edd3e54f">frame_index</a>]);</div><div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>&#160;    assert(!err);</div><div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>&#160;</div><div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">separate_present_queue</a>) {</div><div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>&#160;        <span class="comment">// If we are using separate queues, change image ownership to the</span></div><div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>&#160;        <span class="comment">// present queue before presenting, waiting for the draw complete</span></div><div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>&#160;        <span class="comment">// semaphore and signalling the ownership released semaphore when finished</span></div><div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>&#160;        VkFence nullFence = VK_NULL_HANDLE;</div><div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>&#160;        pipe_stage_flags = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;</div><div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>&#160;        submit_info.waitSemaphoreCount = 1;</div><div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>&#160;        submit_info.pWaitSemaphores = &amp;demo-&gt;<a class="code" href="structdemo.html#ab86850eb961f077b1c65bbfa50f4111e">draw_complete_semaphores</a>[demo-&gt;<a class="code" href="structdemo.html#abbac641d0c27f49b126a4e08edd3e54f">frame_index</a>];</div><div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>&#160;        submit_info.commandBufferCount = 1;</div><div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>&#160;        submit_info.pCommandBuffers = &amp;demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[demo-&gt;<a class="code" href="structdemo.html#a8ef0be14f77810d25d103241361daa30">current_buffer</a>].<a class="code" href="struct_swapchain_image_resources.html#a7dc70d5748a9ff416efe19a67ad8e8f8">graphics_to_present_cmd</a>;</div><div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>&#160;        submit_info.signalSemaphoreCount = 1;</div><div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>&#160;        submit_info.pSignalSemaphores = &amp;demo-&gt;<a class="code" href="structdemo.html#a2bba0ce9e5e1866670c37cec1ed784c5">image_ownership_semaphores</a>[demo-&gt;<a class="code" href="structdemo.html#abbac641d0c27f49b126a4e08edd3e54f">frame_index</a>];</div><div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>&#160;        err = vkQueueSubmit(demo-&gt;<a class="code" href="structdemo.html#afd529ef5cf4122199b49e313c57c054a">present_queue</a>, 1, &amp;submit_info, nullFence);</div><div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>&#160;        assert(!err);</div><div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>&#160;    }</div><div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>&#160;</div><div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>&#160;    <span class="comment">// If we are using separate queues we have to wait for image ownership,</span></div><div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>&#160;    <span class="comment">// otherwise wait for draw complete</span></div><div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>&#160;    VkPresentInfoKHR present = {</div><div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>&#160;        .sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR,</div><div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>&#160;        .waitSemaphoreCount = 1,</div><div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>&#160;        .pWaitSemaphores = (demo-&gt;<a class="code" href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">separate_present_queue</a>) ? &amp;demo-&gt;<a class="code" href="structdemo.html#a2bba0ce9e5e1866670c37cec1ed784c5">image_ownership_semaphores</a>[demo-&gt;<a class="code" href="structdemo.html#abbac641d0c27f49b126a4e08edd3e54f">frame_index</a>]</div><div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>&#160;                                                          : &amp;demo-&gt;<a class="code" href="structdemo.html#ab86850eb961f077b1c65bbfa50f4111e">draw_complete_semaphores</a>[demo-&gt;<a class="code" href="structdemo.html#abbac641d0c27f49b126a4e08edd3e54f">frame_index</a>],</div><div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>&#160;        .swapchainCount = 1,</div><div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>&#160;        .pSwapchains = &amp;demo-&gt;<a class="code" href="structdemo.html#a29b10893f1569e17a99027963c2fed3b">swapchain</a>,</div><div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>&#160;        .pImageIndices = &amp;demo-&gt;<a class="code" href="structdemo.html#a8ef0be14f77810d25d103241361daa30">current_buffer</a>,</div><div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>&#160;    };</div><div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>&#160;</div><div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a07f0cd13803de3f7a2dcdb7274a448c3">VK_KHR_incremental_present_enabled</a>) {</div><div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>&#160;        <span class="comment">// If using VK_KHR_incremental_present, we provide a hint of the region</span></div><div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>&#160;        <span class="comment">// that contains changed content relative to the previously-presented</span></div><div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>&#160;        <span class="comment">// image.  The implementation can use this hint in order to save</span></div><div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>&#160;        <span class="comment">// work/power (by only copying the region in the hint).  The</span></div><div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>&#160;        <span class="comment">// implementation is free to ignore the hint though, and so we must</span></div><div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>&#160;        <span class="comment">// ensure that the entire image has the correctly-drawn content.</span></div><div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>&#160;        uint32_t eighthOfWidth = demo-&gt;<a class="code" href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">width</a> / 8;</div><div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>&#160;        uint32_t eighthOfHeight = demo-&gt;<a class="code" href="structdemo.html#a471d07293ae638531f808771c9975c07">height</a> / 8;</div><div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>&#160;        VkRectLayerKHR rect = {</div><div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>&#160;            .offset.x = eighthOfWidth,</div><div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>&#160;            .offset.y = eighthOfHeight,</div><div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>&#160;            .extent.width = eighthOfWidth * 6,</div><div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>&#160;            .extent.height = eighthOfHeight * 6,</div><div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>&#160;            .layer = 0,</div><div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>&#160;        };</div><div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>&#160;        VkPresentRegionKHR region = {</div><div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>&#160;            .rectangleCount = 1,</div><div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>&#160;            .pRectangles = &amp;rect,</div><div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>&#160;        };</div><div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>&#160;        VkPresentRegionsKHR regions = {</div><div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>&#160;            .sType = VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR,</div><div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>&#160;            .pNext = present.pNext,</div><div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>&#160;            .swapchainCount = present.swapchainCount,</div><div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>&#160;            .pRegions = &amp;region,</div><div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>&#160;        };</div><div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>&#160;        present.pNext = &amp;regions;</div><div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>&#160;    }</div><div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>&#160;</div><div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a31e84ca0ec847d04922fa8d1b9efacb7">VK_GOOGLE_display_timing_enabled</a>) {</div><div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>&#160;        VkPresentTimeGOOGLE ptime;</div><div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>&#160;        <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a2a29d089e3aa3044b8aa9a42d0a696d3">prev_desired_present_time</a> == 0) {</div><div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>&#160;            <span class="comment">// This must be the first present for this swapchain.</span></div><div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>&#160;            <span class="comment">//</span></div><div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>&#160;            <span class="comment">// We don&#39;t know where we are relative to the presentation engine&#39;s</span></div><div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>&#160;            <span class="comment">// display&#39;s refresh cycle.  We also don&#39;t know how long rendering</span></div><div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>&#160;            <span class="comment">// takes.  Let&#39;s make a grossly-simplified assumption that the</span></div><div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>&#160;            <span class="comment">// desiredPresentTime should be half way between now and</span></div><div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>&#160;            <span class="comment">// now+target_IPD.  We will adjust over time.</span></div><div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>&#160;            uint64_t curtime = getTimeInNanoseconds();</div><div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>&#160;            <span class="keywordflow">if</span> (curtime == 0) {</div><div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>&#160;                <span class="comment">// Since we didn&#39;t find out the current time, don&#39;t give a</span></div><div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>&#160;                <span class="comment">// desiredPresentTime:</span></div><div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>&#160;                ptime.desiredPresentTime = 0;</div><div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>&#160;            } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>&#160;                ptime.desiredPresentTime = curtime + (demo-&gt;<a class="code" href="structdemo.html#a6565c3c9d86ea398f943fd3f9cf7be46">target_IPD</a> &gt;&gt; 1);</div><div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>&#160;            }</div><div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>&#160;        } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>&#160;            ptime.desiredPresentTime = (demo-&gt;<a class="code" href="structdemo.html#a2a29d089e3aa3044b8aa9a42d0a696d3">prev_desired_present_time</a> + demo-&gt;<a class="code" href="structdemo.html#a6565c3c9d86ea398f943fd3f9cf7be46">target_IPD</a>);</div><div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>&#160;        }</div><div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>&#160;        ptime.presentID = demo-&gt;<a class="code" href="structdemo.html#a316d35245b2cbcfb681c24a5c8b0ca9b">next_present_id</a>++;</div><div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a2a29d089e3aa3044b8aa9a42d0a696d3">prev_desired_present_time</a> = ptime.desiredPresentTime;</div><div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>&#160;</div><div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>&#160;        VkPresentTimesInfoGOOGLE present_time = {</div><div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>&#160;            .sType = VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE,</div><div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>&#160;            .pNext = present.pNext,</div><div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>&#160;            .swapchainCount = present.swapchainCount,</div><div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>&#160;            .pTimes = &amp;ptime,</div><div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>&#160;        };</div><div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>&#160;        <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a31e84ca0ec847d04922fa8d1b9efacb7">VK_GOOGLE_display_timing_enabled</a>) {</div><div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>&#160;            present.pNext = &amp;present_time;</div><div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>&#160;        }</div><div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>&#160;    }</div><div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>&#160;</div><div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>&#160;    err = demo-&gt;<a class="code" href="structdemo.html#a42d19b35dba5dc4e22269b43be7fe5c4">fpQueuePresentKHR</a>(demo-&gt;<a class="code" href="structdemo.html#afd529ef5cf4122199b49e313c57c054a">present_queue</a>, &amp;present);</div><div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#abbac641d0c27f49b126a4e08edd3e54f">frame_index</a> += 1;</div><div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#abbac641d0c27f49b126a4e08edd3e54f">frame_index</a> %= <a class="code" href="cube_8c.html#a44a58ed35161ff13de8fbf41f913a729">FRAME_LAG</a>;</div><div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>&#160;</div><div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>&#160;    <span class="keywordflow">if</span> (err == VK_ERROR_OUT_OF_DATE_KHR) {</div><div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>&#160;        <span class="comment">// demo-&gt;swapchain is out of date (e.g. the window was resized) and</span></div><div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>&#160;        <span class="comment">// must be recreated:</span></div><div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>&#160;        <a class="code" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a">demo_resize</a>(demo);</div><div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (err == VK_SUBOPTIMAL_KHR) {</div><div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>&#160;        <span class="comment">// demo-&gt;swapchain is not as optimal as it could be, but the platform&#39;s</span></div><div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>&#160;        <span class="comment">// presentation engine will still present the image correctly.</span></div><div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>&#160;        assert(!err);</div><div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>&#160;    }</div><div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>&#160;}</div><div class="ttc" id="structdemo_html_a2a29d089e3aa3044b8aa9a42d0a696d3"><div class="ttname"><a href="structdemo.html#a2a29d089e3aa3044b8aa9a42d0a696d3">demo::prev_desired_present_time</a></div><div class="ttdeci">uint64_t prev_desired_present_time</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00351">cube.c:351</a></div></div>
<div class="ttc" id="structdemo_html_a31e84ca0ec847d04922fa8d1b9efacb7"><div class="ttname"><a href="structdemo.html#a31e84ca0ec847d04922fa8d1b9efacb7">demo::VK_GOOGLE_display_timing_enabled</a></div><div class="ttdeci">bool VK_GOOGLE_display_timing_enabled</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00346">cube.c:346</a></div></div>
<div class="ttc" id="cube_8c_html_ac51a47d75843a542182cb6c2e997c67a"><div class="ttname"><a href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a">demo_resize</a></div><div class="ttdeci">static void demo_resize(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l02283">cube.c:2283</a></div></div>
<div class="ttc" id="structdemo_html_a29b10893f1569e17a99027963c2fed3b"><div class="ttname"><a href="structdemo.html#a29b10893f1569e17a99027963c2fed3b">demo::swapchain</a></div><div class="ttdeci">VkSwapchainKHR swapchain</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00391">cube.c:391</a></div></div>
<div class="ttc" id="structdemo_html_a6565c3c9d86ea398f943fd3f9cf7be46"><div class="ttname"><a href="structdemo.html#a6565c3c9d86ea398f943fd3f9cf7be46">demo::target_IPD</a></div><div class="ttdeci">uint64_t target_IPD</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00350">cube.c:350</a></div></div>
<div class="ttc" id="structdemo_html_abbac641d0c27f49b126a4e08edd3e54f"><div class="ttname"><a href="structdemo.html#abbac641d0c27f49b126a4e08edd3e54f">demo::frame_index</a></div><div class="ttdeci">int frame_index</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00395">cube.c:395</a></div></div>
<div class="ttc" id="structdemo_html_aee60ae051d1ee577f267ecc3b8da36ef"><div class="ttname"><a href="structdemo.html#aee60ae051d1ee577f267ecc3b8da36ef">demo::fences</a></div><div class="ttdeci">VkFence fences[FRAME_LAG]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00394">cube.c:394</a></div></div>
<div class="ttc" id="cube_8c_html_a44a58ed35161ff13de8fbf41f913a729"><div class="ttname"><a href="cube_8c.html#a44a58ed35161ff13de8fbf41f913a729">FRAME_LAG</a></div><div class="ttdeci">#define FRAME_LAG</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00071">cube.c:71</a></div></div>
<div class="ttc" id="structdemo_html_a2bba0ce9e5e1866670c37cec1ed784c5"><div class="ttname"><a href="structdemo.html#a2bba0ce9e5e1866670c37cec1ed784c5">demo::image_ownership_semaphores</a></div><div class="ttdeci">VkSemaphore image_ownership_semaphores[FRAME_LAG]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00365">cube.c:365</a></div></div>
<div class="ttc" id="structdemo_html_a471d07293ae638531f808771c9975c07"><div class="ttname"><a href="structdemo.html#a471d07293ae638531f808771c9975c07">demo::height</a></div><div class="ttdeci">int height</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="structdemo_html_ae0d984aad2f9eb0779c6ec09df17d183"><div class="ttname"><a href="structdemo.html#ae0d984aad2f9eb0779c6ec09df17d183">demo::image_acquired_semaphores</a></div><div class="ttdeci">VkSemaphore image_acquired_semaphores[FRAME_LAG]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00363">cube.c:363</a></div></div>
<div class="ttc" id="structdemo_html_a139cab94cb0a578562759d7f315ca0b5"><div class="ttname"><a href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">demo::swapchain_image_resources</a></div><div class="ttdeci">SwapchainImageResources * swapchain_image_resources</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00392">cube.c:392</a></div></div>
<div class="ttc" id="structdemo_html_abf27a3cd9fc6390bfb89202443aca026"><div class="ttname"><a href="structdemo.html#abf27a3cd9fc6390bfb89202443aca026">demo::graphics_queue</a></div><div class="ttdeci">VkQueue graphics_queue</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00359">cube.c:359</a></div></div>
<div class="ttc" id="structdemo_html_a42d19b35dba5dc4e22269b43be7fe5c4"><div class="ttname"><a href="structdemo.html#a42d19b35dba5dc4e22269b43be7fe5c4">demo::fpQueuePresentKHR</a></div><div class="ttdeci">PFN_vkQueuePresentKHR fpQueuePresentKHR</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00387">cube.c:387</a></div></div>
<div class="ttc" id="structdemo_html_aefb7c2f7c02ba26597ac9fcab061c465"><div class="ttname"><a href="structdemo.html#aefb7c2f7c02ba26597ac9fcab061c465">demo::fpAcquireNextImageKHR</a></div><div class="ttdeci">PFN_vkAcquireNextImageKHR fpAcquireNextImageKHR</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00386">cube.c:386</a></div></div>
<div class="ttc" id="structdemo_html_ab86850eb961f077b1c65bbfa50f4111e"><div class="ttname"><a href="structdemo.html#ab86850eb961f077b1c65bbfa50f4111e">demo::draw_complete_semaphores</a></div><div class="ttdeci">VkSemaphore draw_complete_semaphores[FRAME_LAG]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00364">cube.c:364</a></div></div>
<div class="ttc" id="structdemo_html_a07f0cd13803de3f7a2dcdb7274a448c3"><div class="ttname"><a href="structdemo.html#a07f0cd13803de3f7a2dcdb7274a448c3">demo::VK_KHR_incremental_present_enabled</a></div><div class="ttdeci">bool VK_KHR_incremental_present_enabled</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00344">cube.c:344</a></div></div>
<div class="ttc" id="structdemo_html_a316d35245b2cbcfb681c24a5c8b0ca9b"><div class="ttname"><a href="structdemo.html#a316d35245b2cbcfb681c24a5c8b0ca9b">demo::next_present_id</a></div><div class="ttdeci">uint32_t next_present_id</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00352">cube.c:352</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_a79020e20ddd6a4fe9bc9489a12d05696"><div class="ttname"><a href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">demo::width</a></div><div class="ttdeci">int width</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a01f3d0317c7802a763e58e9817b7f3c2"><div class="ttname"><a href="struct_swapchain_image_resources.html#a01f3d0317c7802a763e58e9817b7f3c2">SwapchainImageResources::cmd</a></div><div class="ttdeci">VkCommandBuffer cmd</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00296">cube.c:296</a></div></div>
<div class="ttc" id="cube_8c_html_a2967b050fc63b30dc0cf382fbcf8f3c6"><div class="ttname"><a href="cube_8c.html#a2967b050fc63b30dc0cf382fbcf8f3c6">demo_update_data_buffer</a></div><div class="ttdeci">void demo_update_data_buffer(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00865">cube.c:865</a></div></div>
<div class="ttc" id="structdemo_html_a894fb54cff1b88236c70332f35c40e04"><div class="ttname"><a href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">demo::separate_present_queue</a></div><div class="ttdeci">bool separate_present_queue</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00341">cube.c:341</a></div></div>
<div class="ttc" id="cube_8c_html_a004704ce51b4b63b3d59eef1d5ea2cee"><div class="ttname"><a href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee">DemoUpdateTargetIPD</a></div><div class="ttdeci">void DemoUpdateTargetIPD(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00887">cube.c:887</a></div></div>
<div class="ttc" id="structdemo_html_a8ef0be14f77810d25d103241361daa30"><div class="ttname"><a href="structdemo.html#a8ef0be14f77810d25d103241361daa30">demo::current_buffer</a></div><div class="ttdeci">uint32_t current_buffer</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00449">cube.c:449</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a7dc70d5748a9ff416efe19a67ad8e8f8"><div class="ttname"><a href="struct_swapchain_image_resources.html#a7dc70d5748a9ff416efe19a67ad8e8f8">SwapchainImageResources::graphics_to_present_cmd</a></div><div class="ttdeci">VkCommandBuffer graphics_to_present_cmd</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00297">cube.c:297</a></div></div>
<div class="ttc" id="structdemo_html_afd529ef5cf4122199b49e313c57c054a"><div class="ttname"><a href="structdemo.html#afd529ef5cf4122199b49e313c57c054a">demo::present_queue</a></div><div class="ttdeci">VkQueue present_queue</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00360">cube.c:360</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a68587107d1c17fe6680e438488b9a616_cgraph.png" border="0" usemap="#cube_8c_a68587107d1c17fe6680e438488b9a616_cgraph" alt=""/></div>
<map name="cube_8c_a68587107d1c17fe6680e438488b9a616_cgraph" id="cube_8c_a68587107d1c17fe6680e438488b9a616_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="535,371,631,398"/>
<area shape="rect" id="node25" href="cube_8c.html#a2967b050fc63b30dc0cf382fbcf8f3c6" title="demo_update_data_buffer" alt="" coords="141,371,312,398"/>
<area shape="rect" id="node26" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="149,321,304,347"/>
<area shape="rect" id="node3" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="679,371,783,398"/>
<area shape="rect" id="node4" href="cube_8c.html#a0c4cc92dc1a3456d6cca76e3187f2010" title="demo_prepare_buffers" alt="" coords="869,22,1019,49"/>
<area shape="rect" id="node5" href="cube_8c.html#a3569c83afeb4ecc4d8d797af29ce89ed" title="demo_prepare_depth" alt="" coords="1119,189,1262,215"/>
<area shape="rect" id="node7" href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7" title="demo_prepare_textures" alt="" coords="865,73,1023,99"/>
<area shape="rect" id="node11" href="cube_8c.html#a21da8dc23d75bc75b5dbe7dd01130739" title="demo_prepare_cube_data\l_buffers" alt="" coords="1105,123,1276,164"/>
<area shape="rect" id="node12" href="cube_8c.html#a36308c10e305d94d63e96fc82be78950" title="demo_prepare_descriptor\l_layout" alt="" coords="860,229,1028,271"/>
<area shape="rect" id="node13" href="cube_8c.html#a4ac6098487e1fc2305847f666891cdec" title="demo_prepare_render_pass" alt="" coords="853,295,1035,322"/>
<area shape="rect" id="node14" href="cube_8c.html#aa80cd8877b6b5d20217c451b207ca9d9" title="demo_prepare_pipeline" alt="" coords="867,346,1021,373"/>
<area shape="rect" id="node18" href="cube_8c.html#ad1571a7e9407fa30327f858d07ea6702" title="demo_build_image_ownership_cmd" alt="" coords="831,397,1057,423"/>
<area shape="rect" id="node19" href="cube_8c.html#a4ee7f5efc65c5972db015c6be8cda380" title="demo_prepare_descriptor_pool" alt="" coords="845,447,1043,474"/>
<area shape="rect" id="node20" href="cube_8c.html#ac1957f225fabd1755a0064169fa5f6ba" title="demo_prepare_descriptor_set" alt="" coords="847,498,1041,525"/>
<area shape="rect" id="node21" href="cube_8c.html#a3a72610dc44a370494307b568ef3abd6" title="demo_prepare_framebuffers" alt="" coords="853,549,1035,575"/>
<area shape="rect" id="node22" href="cube_8c.html#aa9f275ddb85f8473f44c01a00ccfba63" title="demo_draw_build_cmd" alt="" coords="867,599,1021,626"/>
<area shape="rect" id="node23" href="cube_8c.html#a7a35f4639d32b3ac59dd725668a363ba" title="demo_flush_init_cmd" alt="" coords="872,650,1016,677"/>
<area shape="rect" id="node24" href="cube_8c.html#a10612fc5c33836b531554ee572b389f2" title="demo_destroy_texture\l_image" alt="" coords="869,701,1019,743"/>
<area shape="rect" id="node6" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b" title="memory_type_from_properties" alt="" coords="1324,130,1521,157"/>
<area shape="rect" id="node8" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731" title="demo_prepare_texture\l_image" alt="" coords="1115,5,1266,47"/>
<area shape="rect" id="node10" href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8" title="demo_set_image_layout" alt="" coords="1109,71,1272,98"/>
<area shape="rect" id="node9" href="cube_8c.html#add4fd1e03edd51503c9c554e77a042fa" title="loadTexture" alt="" coords="1378,13,1467,39"/>
<area shape="rect" id="node15" href="cube_8c.html#ab1d134177a8964ce85593b229fc7f688" title="demo_prepare_vs" alt="" coords="1129,321,1252,347"/>
<area shape="rect" id="node17" href="cube_8c.html#ab89d9436b88fd3dea5de8cb03de51e94" title="demo_prepare_fs" alt="" coords="1130,371,1251,398"/>
<area shape="rect" id="node16" href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c" title="demo_prepare_shader\l_module" alt="" coords="1347,339,1498,380"/>
<area shape="rect" id="node27" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="360,321,487,347"/>
<area shape="rect" id="node28" href="cube_8c.html#ab9ca7a0a208ec589229116f2de6ee77c" title="ActualTimeLate" alt="" coords="367,371,479,398"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a68587107d1c17fe6680e438488b9a616_icgraph.png" border="0" usemap="#cube_8c_a68587107d1c17fe6680e438488b9a616_icgraph" alt=""/></div>
<map name="cube_8c_a68587107d1c17fe6680e438488b9a616_icgraph" id="cube_8c_a68587107d1c17fe6680e438488b9a616_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="392,56,539,83"/>
<area shape="rect" id="node4" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="141,56,220,83"/>
<area shape="rect" id="node3" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="587,95,660,121"/>
<area shape="rect" id="node5" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="268,81,344,108"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="aa9f275ddb85f8473f44c01a00ccfba63"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_draw_build_cmd </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VkCommandBuffer&#160;</td>
          <td class="paramname"><em>cmd_buf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00703">703</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00443">demo::CmdBeginDebugUtilsLabelEXT</a>, <a class="el" href="cube_8c_source.html#l00444">demo::CmdEndDebugUtilsLabelEXT</a>, <a class="el" href="cube_8c_source.html#l00449">demo::current_buffer</a>, <a class="el" href="cube_8c_source.html#l00302">SwapchainImageResources::descriptor_set</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00301">SwapchainImageResources::framebuffer</a>, <a class="el" href="cube_8c_source.html#l00361">demo::graphics_queue_family_index</a>, <a class="el" href="cube_8c_source.html#l00375">demo::height</a>, <a class="el" href="cube_8c_source.html#l00295">SwapchainImageResources::image</a>, <a class="el" href="cube_8c_source.html#l00417">demo::pipeline</a>, <a class="el" href="cube_8c_source.html#l00413">demo::pipeline_layout</a>, <a class="el" href="cube_8c_source.html#l00362">demo::present_queue_family_index</a>, <a class="el" href="cube_8c_source.html#l00416">demo::render_pass</a>, <a class="el" href="cube_8c_source.html#l00341">demo::separate_present_queue</a>, <a class="el" href="cube_8c_source.html#l00446">demo::SetDebugUtilsObjectNameEXT</a>, <a class="el" href="cube_8c_source.html#l00392">demo::swapchain_image_resources</a>, <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>, <a class="el" href="cube_8c_source.html#l00435">demo::validate</a>, and <a class="el" href="cube_8c_source.html#l00375">demo::width</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>.</p>
<div class="fragment"><div class="line"><a name="l00703"></a><span class="lineno">  703</span>&#160;                                                                            {</div><div class="line"><a name="l00704"></a><span class="lineno">  704</span>&#160;    VkDebugUtilsLabelEXT label;</div><div class="line"><a name="l00705"></a><span class="lineno">  705</span>&#160;    memset(&amp;label, 0, <span class="keyword">sizeof</span>(label));</div><div class="line"><a name="l00706"></a><span class="lineno">  706</span>&#160;    <span class="keyword">const</span> VkCommandBufferBeginInfo cmd_buf_info = {</div><div class="line"><a name="l00707"></a><span class="lineno">  707</span>&#160;        .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,</div><div class="line"><a name="l00708"></a><span class="lineno">  708</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l00709"></a><span class="lineno">  709</span>&#160;        .flags = VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT,</div><div class="line"><a name="l00710"></a><span class="lineno">  710</span>&#160;        .pInheritanceInfo = NULL,</div><div class="line"><a name="l00711"></a><span class="lineno">  711</span>&#160;    };</div><div class="line"><a name="l00712"></a><span class="lineno">  712</span>&#160;    <span class="keyword">const</span> VkClearValue clear_values[2] = {</div><div class="line"><a name="l00713"></a><span class="lineno">  713</span>&#160;        [0] = {.color.float32 = {0.2f, 0.2f, 0.2f, 0.2f}},</div><div class="line"><a name="l00714"></a><span class="lineno">  714</span>&#160;        [1] = {.depthStencil = {1.0f, 0}},</div><div class="line"><a name="l00715"></a><span class="lineno">  715</span>&#160;    };</div><div class="line"><a name="l00716"></a><span class="lineno">  716</span>&#160;    <span class="keyword">const</span> VkRenderPassBeginInfo rp_begin = {</div><div class="line"><a name="l00717"></a><span class="lineno">  717</span>&#160;        .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,</div><div class="line"><a name="l00718"></a><span class="lineno">  718</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l00719"></a><span class="lineno">  719</span>&#160;        .renderPass = demo-&gt;<a class="code" href="structdemo.html#a759be060753e7516d58c97f59af390ff">render_pass</a>,</div><div class="line"><a name="l00720"></a><span class="lineno">  720</span>&#160;        .framebuffer = demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[demo-&gt;<a class="code" href="structdemo.html#a8ef0be14f77810d25d103241361daa30">current_buffer</a>].<a class="code" href="struct_swapchain_image_resources.html#a09729b546f1f1017e0052fd076299776">framebuffer</a>,</div><div class="line"><a name="l00721"></a><span class="lineno">  721</span>&#160;        .renderArea.offset.x = 0,</div><div class="line"><a name="l00722"></a><span class="lineno">  722</span>&#160;        .renderArea.offset.y = 0,</div><div class="line"><a name="l00723"></a><span class="lineno">  723</span>&#160;        .renderArea.extent.width = demo-&gt;<a class="code" href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">width</a>,</div><div class="line"><a name="l00724"></a><span class="lineno">  724</span>&#160;        .renderArea.extent.height = demo-&gt;<a class="code" href="structdemo.html#a471d07293ae638531f808771c9975c07">height</a>,</div><div class="line"><a name="l00725"></a><span class="lineno">  725</span>&#160;        .clearValueCount = 2,</div><div class="line"><a name="l00726"></a><span class="lineno">  726</span>&#160;        .pClearValues = clear_values,</div><div class="line"><a name="l00727"></a><span class="lineno">  727</span>&#160;    };</div><div class="line"><a name="l00728"></a><span class="lineno">  728</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l00729"></a><span class="lineno">  729</span>&#160;</div><div class="line"><a name="l00730"></a><span class="lineno">  730</span>&#160;    err = vkBeginCommandBuffer(cmd_buf, &amp;cmd_buf_info);</div><div class="line"><a name="l00731"></a><span class="lineno">  731</span>&#160;</div><div class="line"><a name="l00732"></a><span class="lineno">  732</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">validate</a>) {</div><div class="line"><a name="l00733"></a><span class="lineno">  733</span>&#160;        <span class="comment">// Set a name for the command buffer</span></div><div class="line"><a name="l00734"></a><span class="lineno">  734</span>&#160;        VkDebugUtilsObjectNameInfoEXT cmd_buf_name = {</div><div class="line"><a name="l00735"></a><span class="lineno">  735</span>&#160;            .sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT,</div><div class="line"><a name="l00736"></a><span class="lineno">  736</span>&#160;            .pNext = NULL,</div><div class="line"><a name="l00737"></a><span class="lineno">  737</span>&#160;            .objectType = VK_OBJECT_TYPE_COMMAND_BUFFER,</div><div class="line"><a name="l00738"></a><span class="lineno">  738</span>&#160;            .objectHandle = (uint64_t)cmd_buf,</div><div class="line"><a name="l00739"></a><span class="lineno">  739</span>&#160;            .pObjectName = <span class="stringliteral">&quot;CubeDrawCommandBuf&quot;</span>,</div><div class="line"><a name="l00740"></a><span class="lineno">  740</span>&#160;        };</div><div class="line"><a name="l00741"></a><span class="lineno">  741</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a5687f3f32029a20c4b148c7d23f8134d">SetDebugUtilsObjectNameEXT</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;cmd_buf_name);</div><div class="line"><a name="l00742"></a><span class="lineno">  742</span>&#160;</div><div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160;        label.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;</div><div class="line"><a name="l00744"></a><span class="lineno">  744</span>&#160;        label.pNext = NULL;</div><div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160;        label.pLabelName = <span class="stringliteral">&quot;DrawBegin&quot;</span>;</div><div class="line"><a name="l00746"></a><span class="lineno">  746</span>&#160;        label.color[0] = 0.4f;</div><div class="line"><a name="l00747"></a><span class="lineno">  747</span>&#160;        label.color[1] = 0.3f;</div><div class="line"><a name="l00748"></a><span class="lineno">  748</span>&#160;        label.color[2] = 0.2f;</div><div class="line"><a name="l00749"></a><span class="lineno">  749</span>&#160;        label.color[3] = 0.1f;</div><div class="line"><a name="l00750"></a><span class="lineno">  750</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a9063cdb946b5e9b2112a31724681a8c2">CmdBeginDebugUtilsLabelEXT</a>(cmd_buf, &amp;label);</div><div class="line"><a name="l00751"></a><span class="lineno">  751</span>&#160;    }</div><div class="line"><a name="l00752"></a><span class="lineno">  752</span>&#160;</div><div class="line"><a name="l00753"></a><span class="lineno">  753</span>&#160;    assert(!err);</div><div class="line"><a name="l00754"></a><span class="lineno">  754</span>&#160;    vkCmdBeginRenderPass(cmd_buf, &amp;rp_begin, VK_SUBPASS_CONTENTS_INLINE);</div><div class="line"><a name="l00755"></a><span class="lineno">  755</span>&#160;</div><div class="line"><a name="l00756"></a><span class="lineno">  756</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">validate</a>) {</div><div class="line"><a name="l00757"></a><span class="lineno">  757</span>&#160;        label.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;</div><div class="line"><a name="l00758"></a><span class="lineno">  758</span>&#160;        label.pNext = NULL;</div><div class="line"><a name="l00759"></a><span class="lineno">  759</span>&#160;        label.pLabelName = <span class="stringliteral">&quot;InsideRenderPass&quot;</span>;</div><div class="line"><a name="l00760"></a><span class="lineno">  760</span>&#160;        label.color[0] = 8.4f;</div><div class="line"><a name="l00761"></a><span class="lineno">  761</span>&#160;        label.color[1] = 7.3f;</div><div class="line"><a name="l00762"></a><span class="lineno">  762</span>&#160;        label.color[2] = 6.2f;</div><div class="line"><a name="l00763"></a><span class="lineno">  763</span>&#160;        label.color[3] = 7.1f;</div><div class="line"><a name="l00764"></a><span class="lineno">  764</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a9063cdb946b5e9b2112a31724681a8c2">CmdBeginDebugUtilsLabelEXT</a>(cmd_buf, &amp;label);</div><div class="line"><a name="l00765"></a><span class="lineno">  765</span>&#160;    }</div><div class="line"><a name="l00766"></a><span class="lineno">  766</span>&#160;</div><div class="line"><a name="l00767"></a><span class="lineno">  767</span>&#160;    vkCmdBindPipeline(cmd_buf, VK_PIPELINE_BIND_POINT_GRAPHICS, demo-&gt;<a class="code" href="structdemo.html#a7c5bcd70166fdff0cfb40feec15e1a97">pipeline</a>);</div><div class="line"><a name="l00768"></a><span class="lineno">  768</span>&#160;    vkCmdBindDescriptorSets(cmd_buf, VK_PIPELINE_BIND_POINT_GRAPHICS, demo-&gt;<a class="code" href="structdemo.html#a1f9db6e3c3b5edf52eda4d2d95ad9a42">pipeline_layout</a>, 0, 1,</div><div class="line"><a name="l00769"></a><span class="lineno">  769</span>&#160;                            &amp;demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[demo-&gt;<a class="code" href="structdemo.html#a8ef0be14f77810d25d103241361daa30">current_buffer</a>].<a class="code" href="struct_swapchain_image_resources.html#af229c281b85faf95a6bda5aab7a7e348">descriptor_set</a>, 0, NULL);</div><div class="line"><a name="l00770"></a><span class="lineno">  770</span>&#160;    VkViewport viewport;</div><div class="line"><a name="l00771"></a><span class="lineno">  771</span>&#160;    memset(&amp;viewport, 0, <span class="keyword">sizeof</span>(viewport));</div><div class="line"><a name="l00772"></a><span class="lineno">  772</span>&#160;    viewport.height = (float)demo-&gt;<a class="code" href="structdemo.html#a471d07293ae638531f808771c9975c07">height</a>;</div><div class="line"><a name="l00773"></a><span class="lineno">  773</span>&#160;    viewport.width = (<span class="keywordtype">float</span>)demo-&gt;<a class="code" href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">width</a>;</div><div class="line"><a name="l00774"></a><span class="lineno">  774</span>&#160;    viewport.minDepth = (float)0.0f;</div><div class="line"><a name="l00775"></a><span class="lineno">  775</span>&#160;    viewport.maxDepth = (float)1.0f;</div><div class="line"><a name="l00776"></a><span class="lineno">  776</span>&#160;    vkCmdSetViewport(cmd_buf, 0, 1, &amp;viewport);</div><div class="line"><a name="l00777"></a><span class="lineno">  777</span>&#160;</div><div class="line"><a name="l00778"></a><span class="lineno">  778</span>&#160;    VkRect2D scissor;</div><div class="line"><a name="l00779"></a><span class="lineno">  779</span>&#160;    memset(&amp;scissor, 0, <span class="keyword">sizeof</span>(scissor));</div><div class="line"><a name="l00780"></a><span class="lineno">  780</span>&#160;    scissor.extent.width = demo-&gt;<a class="code" href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">width</a>;</div><div class="line"><a name="l00781"></a><span class="lineno">  781</span>&#160;    scissor.extent.height = demo-&gt;<a class="code" href="structdemo.html#a471d07293ae638531f808771c9975c07">height</a>;</div><div class="line"><a name="l00782"></a><span class="lineno">  782</span>&#160;    scissor.offset.x = 0;</div><div class="line"><a name="l00783"></a><span class="lineno">  783</span>&#160;    scissor.offset.y = 0;</div><div class="line"><a name="l00784"></a><span class="lineno">  784</span>&#160;    vkCmdSetScissor(cmd_buf, 0, 1, &amp;scissor);</div><div class="line"><a name="l00785"></a><span class="lineno">  785</span>&#160;</div><div class="line"><a name="l00786"></a><span class="lineno">  786</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">validate</a>) {</div><div class="line"><a name="l00787"></a><span class="lineno">  787</span>&#160;        label.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;</div><div class="line"><a name="l00788"></a><span class="lineno">  788</span>&#160;        label.pNext = NULL;</div><div class="line"><a name="l00789"></a><span class="lineno">  789</span>&#160;        label.pLabelName = <span class="stringliteral">&quot;ActualDraw&quot;</span>;</div><div class="line"><a name="l00790"></a><span class="lineno">  790</span>&#160;        label.color[0] = -0.4f;</div><div class="line"><a name="l00791"></a><span class="lineno">  791</span>&#160;        label.color[1] = -0.3f;</div><div class="line"><a name="l00792"></a><span class="lineno">  792</span>&#160;        label.color[2] = -0.2f;</div><div class="line"><a name="l00793"></a><span class="lineno">  793</span>&#160;        label.color[3] = -0.1f;</div><div class="line"><a name="l00794"></a><span class="lineno">  794</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a9063cdb946b5e9b2112a31724681a8c2">CmdBeginDebugUtilsLabelEXT</a>(cmd_buf, &amp;label);</div><div class="line"><a name="l00795"></a><span class="lineno">  795</span>&#160;    }</div><div class="line"><a name="l00796"></a><span class="lineno">  796</span>&#160;</div><div class="line"><a name="l00797"></a><span class="lineno">  797</span>&#160;    vkCmdDraw(cmd_buf, 12 * 3, 1, 0, 0);</div><div class="line"><a name="l00798"></a><span class="lineno">  798</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">validate</a>) {</div><div class="line"><a name="l00799"></a><span class="lineno">  799</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#ae106507a5332203027ae225fb648ab5f">CmdEndDebugUtilsLabelEXT</a>(cmd_buf);</div><div class="line"><a name="l00800"></a><span class="lineno">  800</span>&#160;    }</div><div class="line"><a name="l00801"></a><span class="lineno">  801</span>&#160;</div><div class="line"><a name="l00802"></a><span class="lineno">  802</span>&#160;    <span class="comment">// Note that ending the renderpass changes the image&#39;s layout from</span></div><div class="line"><a name="l00803"></a><span class="lineno">  803</span>&#160;    <span class="comment">// COLOR_ATTACHMENT_OPTIMAL to PRESENT_SRC_KHR</span></div><div class="line"><a name="l00804"></a><span class="lineno">  804</span>&#160;    vkCmdEndRenderPass(cmd_buf);</div><div class="line"><a name="l00805"></a><span class="lineno">  805</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">validate</a>) {</div><div class="line"><a name="l00806"></a><span class="lineno">  806</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#ae106507a5332203027ae225fb648ab5f">CmdEndDebugUtilsLabelEXT</a>(cmd_buf);</div><div class="line"><a name="l00807"></a><span class="lineno">  807</span>&#160;    }</div><div class="line"><a name="l00808"></a><span class="lineno">  808</span>&#160;</div><div class="line"><a name="l00809"></a><span class="lineno">  809</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">separate_present_queue</a>) {</div><div class="line"><a name="l00810"></a><span class="lineno">  810</span>&#160;        <span class="comment">// We have to transfer ownership from the graphics queue family to the</span></div><div class="line"><a name="l00811"></a><span class="lineno">  811</span>&#160;        <span class="comment">// present queue family to be able to present.  Note that we don&#39;t have</span></div><div class="line"><a name="l00812"></a><span class="lineno">  812</span>&#160;        <span class="comment">// to transfer from present queue family back to graphics queue family at</span></div><div class="line"><a name="l00813"></a><span class="lineno">  813</span>&#160;        <span class="comment">// the start of the next frame because we don&#39;t care about the image&#39;s</span></div><div class="line"><a name="l00814"></a><span class="lineno">  814</span>&#160;        <span class="comment">// contents at that point.</span></div><div class="line"><a name="l00815"></a><span class="lineno">  815</span>&#160;        VkImageMemoryBarrier image_ownership_barrier = {.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,</div><div class="line"><a name="l00816"></a><span class="lineno">  816</span>&#160;                                                        .pNext = NULL,</div><div class="line"><a name="l00817"></a><span class="lineno">  817</span>&#160;                                                        .srcAccessMask = 0,</div><div class="line"><a name="l00818"></a><span class="lineno">  818</span>&#160;                                                        .dstAccessMask = 0,</div><div class="line"><a name="l00819"></a><span class="lineno">  819</span>&#160;                                                        .oldLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,</div><div class="line"><a name="l00820"></a><span class="lineno">  820</span>&#160;                                                        .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,</div><div class="line"><a name="l00821"></a><span class="lineno">  821</span>&#160;                                                        .srcQueueFamilyIndex = demo-&gt;<a class="code" href="structdemo.html#a9f7e94f1331e93955bcfdfb6596fedc1">graphics_queue_family_index</a>,</div><div class="line"><a name="l00822"></a><span class="lineno">  822</span>&#160;                                                        .dstQueueFamilyIndex = demo-&gt;<a class="code" href="structdemo.html#a8e9f41863731d6ab805b8d632f3d0c9d">present_queue_family_index</a>,</div><div class="line"><a name="l00823"></a><span class="lineno">  823</span>&#160;                                                        .image = demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[demo-&gt;<a class="code" href="structdemo.html#a8ef0be14f77810d25d103241361daa30">current_buffer</a>].<a class="code" href="struct_swapchain_image_resources.html#a7faad0d9bcbbb48a1ac11db12f81420c">image</a>,</div><div class="line"><a name="l00824"></a><span class="lineno">  824</span>&#160;                                                        .subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1}};</div><div class="line"><a name="l00825"></a><span class="lineno">  825</span>&#160;</div><div class="line"><a name="l00826"></a><span class="lineno">  826</span>&#160;        vkCmdPipelineBarrier(cmd_buf, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, 0, NULL, 0,</div><div class="line"><a name="l00827"></a><span class="lineno">  827</span>&#160;                             NULL, 1, &amp;image_ownership_barrier);</div><div class="line"><a name="l00828"></a><span class="lineno">  828</span>&#160;    }</div><div class="line"><a name="l00829"></a><span class="lineno">  829</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">validate</a>) {</div><div class="line"><a name="l00830"></a><span class="lineno">  830</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#ae106507a5332203027ae225fb648ab5f">CmdEndDebugUtilsLabelEXT</a>(cmd_buf);</div><div class="line"><a name="l00831"></a><span class="lineno">  831</span>&#160;    }</div><div class="line"><a name="l00832"></a><span class="lineno">  832</span>&#160;    err = vkEndCommandBuffer(cmd_buf);</div><div class="line"><a name="l00833"></a><span class="lineno">  833</span>&#160;    assert(!err);</div><div class="line"><a name="l00834"></a><span class="lineno">  834</span>&#160;}</div><div class="ttc" id="structdemo_html_a5687f3f32029a20c4b148c7d23f8134d"><div class="ttname"><a href="structdemo.html#a5687f3f32029a20c4b148c7d23f8134d">demo::SetDebugUtilsObjectNameEXT</a></div><div class="ttdeci">PFN_vkSetDebugUtilsObjectNameEXT SetDebugUtilsObjectNameEXT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00446">cube.c:446</a></div></div>
<div class="ttc" id="structdemo_html_a8e9f41863731d6ab805b8d632f3d0c9d"><div class="ttname"><a href="structdemo.html#a8e9f41863731d6ab805b8d632f3d0c9d">demo::present_queue_family_index</a></div><div class="ttdeci">uint32_t present_queue_family_index</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00362">cube.c:362</a></div></div>
<div class="ttc" id="structdemo_html_a7c5bcd70166fdff0cfb40feec15e1a97"><div class="ttname"><a href="structdemo.html#a7c5bcd70166fdff0cfb40feec15e1a97">demo::pipeline</a></div><div class="ttdeci">VkPipeline pipeline</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00417">cube.c:417</a></div></div>
<div class="ttc" id="structdemo_html_a471d07293ae638531f808771c9975c07"><div class="ttname"><a href="structdemo.html#a471d07293ae638531f808771c9975c07">demo::height</a></div><div class="ttdeci">int height</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="structdemo_html_a139cab94cb0a578562759d7f315ca0b5"><div class="ttname"><a href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">demo::swapchain_image_resources</a></div><div class="ttdeci">SwapchainImageResources * swapchain_image_resources</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00392">cube.c:392</a></div></div>
<div class="ttc" id="structdemo_html_ae106507a5332203027ae225fb648ab5f"><div class="ttname"><a href="structdemo.html#ae106507a5332203027ae225fb648ab5f">demo::CmdEndDebugUtilsLabelEXT</a></div><div class="ttdeci">PFN_vkCmdEndDebugUtilsLabelEXT CmdEndDebugUtilsLabelEXT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00444">cube.c:444</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a7faad0d9bcbbb48a1ac11db12f81420c"><div class="ttname"><a href="struct_swapchain_image_resources.html#a7faad0d9bcbbb48a1ac11db12f81420c">SwapchainImageResources::image</a></div><div class="ttdeci">VkImage image</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00295">cube.c:295</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a09729b546f1f1017e0052fd076299776"><div class="ttname"><a href="struct_swapchain_image_resources.html#a09729b546f1f1017e0052fd076299776">SwapchainImageResources::framebuffer</a></div><div class="ttdeci">VkFramebuffer framebuffer</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00301">cube.c:301</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_a9f7e94f1331e93955bcfdfb6596fedc1"><div class="ttname"><a href="structdemo.html#a9f7e94f1331e93955bcfdfb6596fedc1">demo::graphics_queue_family_index</a></div><div class="ttdeci">uint32_t graphics_queue_family_index</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00361">cube.c:361</a></div></div>
<div class="ttc" id="structdemo_html_a1f9db6e3c3b5edf52eda4d2d95ad9a42"><div class="ttname"><a href="structdemo.html#a1f9db6e3c3b5edf52eda4d2d95ad9a42">demo::pipeline_layout</a></div><div class="ttdeci">VkPipelineLayout pipeline_layout</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00413">cube.c:413</a></div></div>
<div class="ttc" id="structdemo_html_a79020e20ddd6a4fe9bc9489a12d05696"><div class="ttname"><a href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">demo::width</a></div><div class="ttdeci">int width</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="structdemo_html_a9063cdb946b5e9b2112a31724681a8c2"><div class="ttname"><a href="structdemo.html#a9063cdb946b5e9b2112a31724681a8c2">demo::CmdBeginDebugUtilsLabelEXT</a></div><div class="ttdeci">PFN_vkCmdBeginDebugUtilsLabelEXT CmdBeginDebugUtilsLabelEXT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00443">cube.c:443</a></div></div>
<div class="ttc" id="structdemo_html_a894fb54cff1b88236c70332f35c40e04"><div class="ttname"><a href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">demo::separate_present_queue</a></div><div class="ttdeci">bool separate_present_queue</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00341">cube.c:341</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_af229c281b85faf95a6bda5aab7a7e348"><div class="ttname"><a href="struct_swapchain_image_resources.html#af229c281b85faf95a6bda5aab7a7e348">SwapchainImageResources::descriptor_set</a></div><div class="ttdeci">VkDescriptorSet descriptor_set</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00302">cube.c:302</a></div></div>
<div class="ttc" id="structdemo_html_a3042e9d9a2afa521340ebb55b09e93ef"><div class="ttname"><a href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">demo::validate</a></div><div class="ttdeci">bool validate</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00435">cube.c:435</a></div></div>
<div class="ttc" id="structdemo_html_a8ef0be14f77810d25d103241361daa30"><div class="ttname"><a href="structdemo.html#a8ef0be14f77810d25d103241361daa30">demo::current_buffer</a></div><div class="ttdeci">uint32_t current_buffer</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00449">cube.c:449</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
<div class="ttc" id="structdemo_html_a759be060753e7516d58c97f59af390ff"><div class="ttname"><a href="structdemo.html#a759be060753e7516d58c97f59af390ff">demo::render_pass</a></div><div class="ttdeci">VkRenderPass render_pass</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00416">cube.c:416</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_aa9f275ddb85f8473f44c01a00ccfba63_icgraph.png" border="0" usemap="#cube_8c_aa9f275ddb85f8473f44c01a00ccfba63_icgraph" alt=""/></div>
<map name="cube_8c_aa9f275ddb85f8473f44c01a00ccfba63_icgraph" id="cube_8c_aa9f275ddb85f8473f44c01a00ccfba63_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="208,43,312,69"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="360,93,456,120"/>
<area shape="rect" id="node8" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1463,119,1536,145"/>
<area shape="rect" id="node4" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="504,93,631,120"/>
<area shape="rect" id="node6" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="881,119,969,145"/>
<area shape="rect" id="node7" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1268,119,1415,145"/>
<area shape="rect" id="node10" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1144,245,1220,272"/>
<area shape="rect" id="node5" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="679,93,833,120"/>
<area shape="rect" id="node9" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1017,156,1096,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a7a35f4639d32b3ac59dd725668a363ba"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_flush_init_cmd </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00614">614</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00412">demo::cmd</a>, <a class="el" href="cube_8c_source.html#l00397">demo::cmd_pool</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00359">demo::graphics_queue</a>, and <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>.</p>
<div class="fragment"><div class="line"><a name="l00614"></a><span class="lineno">  614</span>&#160;                                                   {</div><div class="line"><a name="l00615"></a><span class="lineno">  615</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l00616"></a><span class="lineno">  616</span>&#160;</div><div class="line"><a name="l00617"></a><span class="lineno">  617</span>&#160;    <span class="comment">// This function could get called twice if the texture uses a staging buffer</span></div><div class="line"><a name="l00618"></a><span class="lineno">  618</span>&#160;    <span class="comment">// In that case the second call should be ignored</span></div><div class="line"><a name="l00619"></a><span class="lineno">  619</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a5f52e6ec2780b7c5395983efe51bcb34">cmd</a> == VK_NULL_HANDLE) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00620"></a><span class="lineno">  620</span>&#160;</div><div class="line"><a name="l00621"></a><span class="lineno">  621</span>&#160;    err = vkEndCommandBuffer(demo-&gt;<a class="code" href="structdemo.html#a5f52e6ec2780b7c5395983efe51bcb34">cmd</a>);</div><div class="line"><a name="l00622"></a><span class="lineno">  622</span>&#160;    assert(!err);</div><div class="line"><a name="l00623"></a><span class="lineno">  623</span>&#160;</div><div class="line"><a name="l00624"></a><span class="lineno">  624</span>&#160;    VkFence fence;</div><div class="line"><a name="l00625"></a><span class="lineno">  625</span>&#160;    VkFenceCreateInfo fence_ci = {.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, .pNext = NULL, .flags = 0};</div><div class="line"><a name="l00626"></a><span class="lineno">  626</span>&#160;    err = vkCreateFence(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;fence_ci, NULL, &amp;fence);</div><div class="line"><a name="l00627"></a><span class="lineno">  627</span>&#160;    assert(!err);</div><div class="line"><a name="l00628"></a><span class="lineno">  628</span>&#160;</div><div class="line"><a name="l00629"></a><span class="lineno">  629</span>&#160;    <span class="keyword">const</span> VkCommandBuffer cmd_bufs[] = {demo-&gt;<a class="code" href="structdemo.html#a5f52e6ec2780b7c5395983efe51bcb34">cmd</a>};</div><div class="line"><a name="l00630"></a><span class="lineno">  630</span>&#160;    VkSubmitInfo submit_info = {.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,</div><div class="line"><a name="l00631"></a><span class="lineno">  631</span>&#160;                                .pNext = NULL,</div><div class="line"><a name="l00632"></a><span class="lineno">  632</span>&#160;                                .waitSemaphoreCount = 0,</div><div class="line"><a name="l00633"></a><span class="lineno">  633</span>&#160;                                .pWaitSemaphores = NULL,</div><div class="line"><a name="l00634"></a><span class="lineno">  634</span>&#160;                                .pWaitDstStageMask = NULL,</div><div class="line"><a name="l00635"></a><span class="lineno">  635</span>&#160;                                .commandBufferCount = 1,</div><div class="line"><a name="l00636"></a><span class="lineno">  636</span>&#160;                                .pCommandBuffers = cmd_bufs,</div><div class="line"><a name="l00637"></a><span class="lineno">  637</span>&#160;                                .signalSemaphoreCount = 0,</div><div class="line"><a name="l00638"></a><span class="lineno">  638</span>&#160;                                .pSignalSemaphores = NULL};</div><div class="line"><a name="l00639"></a><span class="lineno">  639</span>&#160;</div><div class="line"><a name="l00640"></a><span class="lineno">  640</span>&#160;    err = vkQueueSubmit(demo-&gt;<a class="code" href="structdemo.html#abf27a3cd9fc6390bfb89202443aca026">graphics_queue</a>, 1, &amp;submit_info, fence);</div><div class="line"><a name="l00641"></a><span class="lineno">  641</span>&#160;    assert(!err);</div><div class="line"><a name="l00642"></a><span class="lineno">  642</span>&#160;</div><div class="line"><a name="l00643"></a><span class="lineno">  643</span>&#160;    err = vkWaitForFences(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, 1, &amp;fence, VK_TRUE, UINT64_MAX);</div><div class="line"><a name="l00644"></a><span class="lineno">  644</span>&#160;    assert(!err);</div><div class="line"><a name="l00645"></a><span class="lineno">  645</span>&#160;</div><div class="line"><a name="l00646"></a><span class="lineno">  646</span>&#160;    vkFreeCommandBuffers(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#af527d51e6fafb65fec23e3b95b622b93">cmd_pool</a>, 1, cmd_bufs);</div><div class="line"><a name="l00647"></a><span class="lineno">  647</span>&#160;    vkDestroyFence(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, fence, NULL);</div><div class="line"><a name="l00648"></a><span class="lineno">  648</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a5f52e6ec2780b7c5395983efe51bcb34">cmd</a> = VK_NULL_HANDLE;</div><div class="line"><a name="l00649"></a><span class="lineno">  649</span>&#160;}</div><div class="ttc" id="structdemo_html_af527d51e6fafb65fec23e3b95b622b93"><div class="ttname"><a href="structdemo.html#af527d51e6fafb65fec23e3b95b622b93">demo::cmd_pool</a></div><div class="ttdeci">VkCommandPool cmd_pool</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00397">cube.c:397</a></div></div>
<div class="ttc" id="structdemo_html_abf27a3cd9fc6390bfb89202443aca026"><div class="ttname"><a href="structdemo.html#abf27a3cd9fc6390bfb89202443aca026">demo::graphics_queue</a></div><div class="ttdeci">VkQueue graphics_queue</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00359">cube.c:359</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_a5f52e6ec2780b7c5395983efe51bcb34"><div class="ttname"><a href="structdemo.html#a5f52e6ec2780b7c5395983efe51bcb34">demo::cmd</a></div><div class="ttdeci">VkCommandBuffer cmd</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00412">cube.c:412</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a7a35f4639d32b3ac59dd725668a363ba_icgraph.png" border="0" usemap="#cube_8c_a7a35f4639d32b3ac59dd725668a363ba_icgraph" alt=""/></div>
<map name="cube_8c_a7a35f4639d32b3ac59dd725668a363ba_icgraph" id="cube_8c_a7a35f4639d32b3ac59dd725668a363ba_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="197,43,301,69"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="349,93,445,120"/>
<area shape="rect" id="node8" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1452,119,1525,145"/>
<area shape="rect" id="node4" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="493,93,620,120"/>
<area shape="rect" id="node6" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="871,119,959,145"/>
<area shape="rect" id="node7" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1257,119,1404,145"/>
<area shape="rect" id="node10" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1133,245,1209,272"/>
<area shape="rect" id="node5" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="668,93,823,120"/>
<area shape="rect" id="node9" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1007,156,1085,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a9614fd51f6e418355a34964db328d781"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_init </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>argv</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l03608">3608</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00067">APP_SHORT_NAME</a>, <a class="el" href="cube_8c_source.html#l03567">demo_init_connection()</a>, <a class="el" href="cube_8c_source.html#l02849">demo_init_vk()</a>, <a class="el" href="cube_8c_source.html#l00123">ERR_EXIT</a>, <a class="el" href="cube_8c_source.html#l00434">demo::frameCount</a>, <a class="el" href="cube_8c_source.html#l00375">demo::height</a>, <a class="el" href="cube_8c_source.html#l00421">demo::model_matrix</a>, <a class="el" href="cube_8c_source.html#l00425">demo::pause</a>, <a class="el" href="cube_8c_source.html#l00393">demo::presentMode</a>, <a class="el" href="cube_8c_source.html#l00419">demo::projection_matrix</a>, <a class="el" href="cube_8c_source.html#l00423">demo::spin_angle</a>, <a class="el" href="cube_8c_source.html#l00424">demo::spin_increment</a>, <a class="el" href="cube_8c_source.html#l00438">demo::suppress_popups</a>, <a class="el" href="cube_8c_source.html#l00437">demo::use_break</a>, <a class="el" href="cube_8c_source.html#l00340">demo::use_staging_buffer</a>, <a class="el" href="cube_8c_source.html#l00435">demo::validate</a>, <a class="el" href="cube_8c_source.html#l00436">demo::validate_checks_disabled</a>, <a class="el" href="cube_8c_source.html#l00420">demo::view_matrix</a>, <a class="el" href="cube_8c_source.html#l00346">demo::VK_GOOGLE_display_timing_enabled</a>, <a class="el" href="cube_8c_source.html#l00344">demo::VK_KHR_incremental_present_enabled</a>, and <a class="el" href="cube_8c_source.html#l00375">demo::width</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l03702">WinMain()</a>.</p>
<div class="fragment"><div class="line"><a name="l03608"></a><span class="lineno"> 3608</span>&#160;                                                                {</div><div class="line"><a name="l03609"></a><span class="lineno"> 3609</span>&#160;    vec3 eye = {0.0f, 3.0f, 5.0f};</div><div class="line"><a name="l03610"></a><span class="lineno"> 3610</span>&#160;    vec3 origin = {0, 0, 0};</div><div class="line"><a name="l03611"></a><span class="lineno"> 3611</span>&#160;    vec3 up = {0.0f, 1.0f, 0.0};</div><div class="line"><a name="l03612"></a><span class="lineno"> 3612</span>&#160;</div><div class="line"><a name="l03613"></a><span class="lineno"> 3613</span>&#160;    memset(demo, 0, <span class="keyword">sizeof</span>(*demo));</div><div class="line"><a name="l03614"></a><span class="lineno"> 3614</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a812091c8a029af03be7dfac45fbaadad">presentMode</a> = VK_PRESENT_MODE_FIFO_KHR;</div><div class="line"><a name="l03615"></a><span class="lineno"> 3615</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a0c9b20bd3ef8c984594686ba662a48b7">frameCount</a> = INT32_MAX;</div><div class="line"><a name="l03616"></a><span class="lineno"> 3616</span>&#160;</div><div class="line"><a name="l03617"></a><span class="lineno"> 3617</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i &lt; argc; i++) {</div><div class="line"><a name="l03618"></a><span class="lineno"> 3618</span>&#160;        <span class="keywordflow">if</span> (strcmp(argv[i], <span class="stringliteral">&quot;--use_staging&quot;</span>) == 0) {</div><div class="line"><a name="l03619"></a><span class="lineno"> 3619</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#af6a82a8de928dd783df9cde04533e84d">use_staging_buffer</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l03620"></a><span class="lineno"> 3620</span>&#160;            <span class="keywordflow">continue</span>;</div><div class="line"><a name="l03621"></a><span class="lineno"> 3621</span>&#160;        }</div><div class="line"><a name="l03622"></a><span class="lineno"> 3622</span>&#160;        <span class="keywordflow">if</span> ((strcmp(argv[i], <span class="stringliteral">&quot;--present_mode&quot;</span>) == 0) &amp;&amp; (i &lt; argc - 1)) {</div><div class="line"><a name="l03623"></a><span class="lineno"> 3623</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#a812091c8a029af03be7dfac45fbaadad">presentMode</a> = atoi(argv[i + 1]);</div><div class="line"><a name="l03624"></a><span class="lineno"> 3624</span>&#160;            i++;</div><div class="line"><a name="l03625"></a><span class="lineno"> 3625</span>&#160;            <span class="keywordflow">continue</span>;</div><div class="line"><a name="l03626"></a><span class="lineno"> 3626</span>&#160;        }</div><div class="line"><a name="l03627"></a><span class="lineno"> 3627</span>&#160;        <span class="keywordflow">if</span> (strcmp(argv[i], <span class="stringliteral">&quot;--break&quot;</span>) == 0) {</div><div class="line"><a name="l03628"></a><span class="lineno"> 3628</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#a8c231f3030fd6fdba515005a861bbe1a">use_break</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l03629"></a><span class="lineno"> 3629</span>&#160;            <span class="keywordflow">continue</span>;</div><div class="line"><a name="l03630"></a><span class="lineno"> 3630</span>&#160;        }</div><div class="line"><a name="l03631"></a><span class="lineno"> 3631</span>&#160;        <span class="keywordflow">if</span> (strcmp(argv[i], <span class="stringliteral">&quot;--validate&quot;</span>) == 0) {</div><div class="line"><a name="l03632"></a><span class="lineno"> 3632</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">validate</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l03633"></a><span class="lineno"> 3633</span>&#160;            <span class="keywordflow">continue</span>;</div><div class="line"><a name="l03634"></a><span class="lineno"> 3634</span>&#160;        }</div><div class="line"><a name="l03635"></a><span class="lineno"> 3635</span>&#160;        <span class="keywordflow">if</span> (strcmp(argv[i], <span class="stringliteral">&quot;--validate-checks-disabled&quot;</span>) == 0) {</div><div class="line"><a name="l03636"></a><span class="lineno"> 3636</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">validate</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l03637"></a><span class="lineno"> 3637</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#a3019e8f64270299a805d852340e64916">validate_checks_disabled</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l03638"></a><span class="lineno"> 3638</span>&#160;            <span class="keywordflow">continue</span>;</div><div class="line"><a name="l03639"></a><span class="lineno"> 3639</span>&#160;        }</div><div class="line"><a name="l03640"></a><span class="lineno"> 3640</span>&#160;        <span class="keywordflow">if</span> (strcmp(argv[i], <span class="stringliteral">&quot;--xlib&quot;</span>) == 0) {</div><div class="line"><a name="l03641"></a><span class="lineno"> 3641</span>&#160;            fprintf(stderr, <span class="stringliteral">&quot;--xlib is deprecated and no longer does anything&quot;</span>);</div><div class="line"><a name="l03642"></a><span class="lineno"> 3642</span>&#160;            <span class="keywordflow">continue</span>;</div><div class="line"><a name="l03643"></a><span class="lineno"> 3643</span>&#160;        }</div><div class="line"><a name="l03644"></a><span class="lineno"> 3644</span>&#160;        <span class="keywordflow">if</span> (strcmp(argv[i], <span class="stringliteral">&quot;--c&quot;</span>) == 0 &amp;&amp; demo-&gt;<a class="code" href="structdemo.html#a0c9b20bd3ef8c984594686ba662a48b7">frameCount</a> == INT32_MAX &amp;&amp; i &lt; argc - 1 &amp;&amp;</div><div class="line"><a name="l03645"></a><span class="lineno"> 3645</span>&#160;            sscanf(argv[i + 1], <span class="stringliteral">&quot;%d&quot;</span>, &amp;demo-&gt;<a class="code" href="structdemo.html#a0c9b20bd3ef8c984594686ba662a48b7">frameCount</a>) == 1 &amp;&amp; demo-&gt;<a class="code" href="structdemo.html#a0c9b20bd3ef8c984594686ba662a48b7">frameCount</a> &gt;= 0) {</div><div class="line"><a name="l03646"></a><span class="lineno"> 3646</span>&#160;            i++;</div><div class="line"><a name="l03647"></a><span class="lineno"> 3647</span>&#160;            <span class="keywordflow">continue</span>;</div><div class="line"><a name="l03648"></a><span class="lineno"> 3648</span>&#160;        }</div><div class="line"><a name="l03649"></a><span class="lineno"> 3649</span>&#160;        <span class="keywordflow">if</span> (strcmp(argv[i], <span class="stringliteral">&quot;--suppress_popups&quot;</span>) == 0) {</div><div class="line"><a name="l03650"></a><span class="lineno"> 3650</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#a0fd8ef6b13e48ea7e550a0a8368ffd81">suppress_popups</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l03651"></a><span class="lineno"> 3651</span>&#160;            <span class="keywordflow">continue</span>;</div><div class="line"><a name="l03652"></a><span class="lineno"> 3652</span>&#160;        }</div><div class="line"><a name="l03653"></a><span class="lineno"> 3653</span>&#160;        <span class="keywordflow">if</span> (strcmp(argv[i], <span class="stringliteral">&quot;--display_timing&quot;</span>) == 0) {</div><div class="line"><a name="l03654"></a><span class="lineno"> 3654</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#a31e84ca0ec847d04922fa8d1b9efacb7">VK_GOOGLE_display_timing_enabled</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l03655"></a><span class="lineno"> 3655</span>&#160;            <span class="keywordflow">continue</span>;</div><div class="line"><a name="l03656"></a><span class="lineno"> 3656</span>&#160;        }</div><div class="line"><a name="l03657"></a><span class="lineno"> 3657</span>&#160;        <span class="keywordflow">if</span> (strcmp(argv[i], <span class="stringliteral">&quot;--incremental_present&quot;</span>) == 0) {</div><div class="line"><a name="l03658"></a><span class="lineno"> 3658</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#a07f0cd13803de3f7a2dcdb7274a448c3">VK_KHR_incremental_present_enabled</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l03659"></a><span class="lineno"> 3659</span>&#160;            <span class="keywordflow">continue</span>;</div><div class="line"><a name="l03660"></a><span class="lineno"> 3660</span>&#160;        }</div><div class="line"><a name="l03661"></a><span class="lineno"> 3661</span>&#160;</div><div class="line"><a name="l03662"></a><span class="lineno"> 3662</span>&#160;<span class="preprocessor">#if defined(ANDROID)</span></div><div class="line"><a name="l03663"></a><span class="lineno"> 3663</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;Usage: cube [--validate]\n&quot;</span>, <span class="stringliteral">&quot;Usage&quot;</span>);</div><div class="line"><a name="l03664"></a><span class="lineno"> 3664</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l03665"></a><span class="lineno"> 3665</span>&#160;        fprintf(stderr,</div><div class="line"><a name="l03666"></a><span class="lineno"> 3666</span>&#160;                <span class="stringliteral">&quot;Usage:\n  %s\t[--use_staging] [--validate] [--validate-checks-disabled] [--break]\n&quot;</span></div><div class="line"><a name="l03667"></a><span class="lineno"> 3667</span>&#160;                <span class="stringliteral">&quot;\t[--c &lt;framecount&gt;] [--suppress_popups] [--incremental_present] [--display_timing]\n&quot;</span></div><div class="line"><a name="l03668"></a><span class="lineno"> 3668</span>&#160;                <span class="stringliteral">&quot;\t[--present_mode &lt;present mode enum&gt;]\n&quot;</span></div><div class="line"><a name="l03669"></a><span class="lineno"> 3669</span>&#160;                <span class="stringliteral">&quot;\t &lt;present_mode_enum&gt;\tVK_PRESENT_MODE_IMMEDIATE_KHR = %d\n&quot;</span></div><div class="line"><a name="l03670"></a><span class="lineno"> 3670</span>&#160;                <span class="stringliteral">&quot;\t\t\t\tVK_PRESENT_MODE_MAILBOX_KHR = %d\n&quot;</span></div><div class="line"><a name="l03671"></a><span class="lineno"> 3671</span>&#160;                <span class="stringliteral">&quot;\t\t\t\tVK_PRESENT_MODE_FIFO_KHR = %d\n&quot;</span></div><div class="line"><a name="l03672"></a><span class="lineno"> 3672</span>&#160;                <span class="stringliteral">&quot;\t\t\t\tVK_PRESENT_MODE_FIFO_RELAXED_KHR = %d\n&quot;</span>,</div><div class="line"><a name="l03673"></a><span class="lineno"> 3673</span>&#160;                <a class="code" href="cube_8c.html#ab5541e08a357bb88cd008693b6ffc6db">APP_SHORT_NAME</a>, VK_PRESENT_MODE_IMMEDIATE_KHR, VK_PRESENT_MODE_MAILBOX_KHR, VK_PRESENT_MODE_FIFO_KHR,</div><div class="line"><a name="l03674"></a><span class="lineno"> 3674</span>&#160;                VK_PRESENT_MODE_FIFO_RELAXED_KHR);</div><div class="line"><a name="l03675"></a><span class="lineno"> 3675</span>&#160;        fflush(stderr);</div><div class="line"><a name="l03676"></a><span class="lineno"> 3676</span>&#160;        exit(1);</div><div class="line"><a name="l03677"></a><span class="lineno"> 3677</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l03678"></a><span class="lineno"> 3678</span>&#160;    }</div><div class="line"><a name="l03679"></a><span class="lineno"> 3679</span>&#160;</div><div class="line"><a name="l03680"></a><span class="lineno"> 3680</span>&#160;    <a class="code" href="cube_8c.html#ad89af5ea893ea45fdcd5478c0eb8edde">demo_init_connection</a>(demo);</div><div class="line"><a name="l03681"></a><span class="lineno"> 3681</span>&#160;</div><div class="line"><a name="l03682"></a><span class="lineno"> 3682</span>&#160;    <a class="code" href="cube_8c.html#abdcd6d1f2fdbb957fd5c0337d86a286c">demo_init_vk</a>(demo);</div><div class="line"><a name="l03683"></a><span class="lineno"> 3683</span>&#160;</div><div class="line"><a name="l03684"></a><span class="lineno"> 3684</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">width</a> = 500;</div><div class="line"><a name="l03685"></a><span class="lineno"> 3685</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a471d07293ae638531f808771c9975c07">height</a> = 500;</div><div class="line"><a name="l03686"></a><span class="lineno"> 3686</span>&#160;</div><div class="line"><a name="l03687"></a><span class="lineno"> 3687</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a864cd80008ffc0cff93395d67a77fc61">spin_angle</a> = 4.0f;</div><div class="line"><a name="l03688"></a><span class="lineno"> 3688</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a58a4576f83df5904f5381578f6b23b78">spin_increment</a> = 0.2f;</div><div class="line"><a name="l03689"></a><span class="lineno"> 3689</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#ab1ce71654c626c698e6bef21f0191f0c">pause</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l03690"></a><span class="lineno"> 3690</span>&#160;</div><div class="line"><a name="l03691"></a><span class="lineno"> 3691</span>&#160;    mat4x4_perspective(demo-&gt;<a class="code" href="structdemo.html#aaedd749233b7ac4c3995f57ed2661760">projection_matrix</a>, (<span class="keywordtype">float</span>)degreesToRadians(45.0f), 1.0f, 0.1f, 100.0f);</div><div class="line"><a name="l03692"></a><span class="lineno"> 3692</span>&#160;    mat4x4_look_at(demo-&gt;<a class="code" href="structdemo.html#a48dbc591ffcf6b9ee0d8da7601221b46">view_matrix</a>, eye, origin, up);</div><div class="line"><a name="l03693"></a><span class="lineno"> 3693</span>&#160;    mat4x4_identity(demo-&gt;<a class="code" href="structdemo.html#ae7f8cd202364dbe492a9bdb47e52c6d6">model_matrix</a>);</div><div class="line"><a name="l03694"></a><span class="lineno"> 3694</span>&#160;</div><div class="line"><a name="l03695"></a><span class="lineno"> 3695</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#aaedd749233b7ac4c3995f57ed2661760">projection_matrix</a>[1][1] *= -1;  <span class="comment">// Flip projection matrix from GL to Vulkan orientation.</span></div><div class="line"><a name="l03696"></a><span class="lineno"> 3696</span>&#160;}</div><div class="ttc" id="structdemo_html_a31e84ca0ec847d04922fa8d1b9efacb7"><div class="ttname"><a href="structdemo.html#a31e84ca0ec847d04922fa8d1b9efacb7">demo::VK_GOOGLE_display_timing_enabled</a></div><div class="ttdeci">bool VK_GOOGLE_display_timing_enabled</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00346">cube.c:346</a></div></div>
<div class="ttc" id="structdemo_html_ab1ce71654c626c698e6bef21f0191f0c"><div class="ttname"><a href="structdemo.html#ab1ce71654c626c698e6bef21f0191f0c">demo::pause</a></div><div class="ttdeci">bool pause</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00425">cube.c:425</a></div></div>
<div class="ttc" id="cube_8c_html_abdcd6d1f2fdbb957fd5c0337d86a286c"><div class="ttname"><a href="cube_8c.html#abdcd6d1f2fdbb957fd5c0337d86a286c">demo_init_vk</a></div><div class="ttdeci">static void demo_init_vk(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l02849">cube.c:2849</a></div></div>
<div class="ttc" id="structdemo_html_a471d07293ae638531f808771c9975c07"><div class="ttname"><a href="structdemo.html#a471d07293ae638531f808771c9975c07">demo::height</a></div><div class="ttdeci">int height</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="structdemo_html_a48dbc591ffcf6b9ee0d8da7601221b46"><div class="ttname"><a href="structdemo.html#a48dbc591ffcf6b9ee0d8da7601221b46">demo::view_matrix</a></div><div class="ttdeci">mat4x4 view_matrix</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00420">cube.c:420</a></div></div>
<div class="ttc" id="structdemo_html_a58a4576f83df5904f5381578f6b23b78"><div class="ttname"><a href="structdemo.html#a58a4576f83df5904f5381578f6b23b78">demo::spin_increment</a></div><div class="ttdeci">float spin_increment</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00424">cube.c:424</a></div></div>
<div class="ttc" id="structdemo_html_aaedd749233b7ac4c3995f57ed2661760"><div class="ttname"><a href="structdemo.html#aaedd749233b7ac4c3995f57ed2661760">demo::projection_matrix</a></div><div class="ttdeci">mat4x4 projection_matrix</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00419">cube.c:419</a></div></div>
<div class="ttc" id="structdemo_html_a07f0cd13803de3f7a2dcdb7274a448c3"><div class="ttname"><a href="structdemo.html#a07f0cd13803de3f7a2dcdb7274a448c3">demo::VK_KHR_incremental_present_enabled</a></div><div class="ttdeci">bool VK_KHR_incremental_present_enabled</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00344">cube.c:344</a></div></div>
<div class="ttc" id="structdemo_html_a0fd8ef6b13e48ea7e550a0a8368ffd81"><div class="ttname"><a href="structdemo.html#a0fd8ef6b13e48ea7e550a0a8368ffd81">demo::suppress_popups</a></div><div class="ttdeci">bool suppress_popups</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00438">cube.c:438</a></div></div>
<div class="ttc" id="structdemo_html_a8c231f3030fd6fdba515005a861bbe1a"><div class="ttname"><a href="structdemo.html#a8c231f3030fd6fdba515005a861bbe1a">demo::use_break</a></div><div class="ttdeci">bool use_break</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00437">cube.c:437</a></div></div>
<div class="ttc" id="structdemo_html_a0c9b20bd3ef8c984594686ba662a48b7"><div class="ttname"><a href="structdemo.html#a0c9b20bd3ef8c984594686ba662a48b7">demo::frameCount</a></div><div class="ttdeci">int32_t frameCount</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00434">cube.c:434</a></div></div>
<div class="ttc" id="structdemo_html_a864cd80008ffc0cff93395d67a77fc61"><div class="ttname"><a href="structdemo.html#a864cd80008ffc0cff93395d67a77fc61">demo::spin_angle</a></div><div class="ttdeci">float spin_angle</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00423">cube.c:423</a></div></div>
<div class="ttc" id="cube_8c_html_ad89af5ea893ea45fdcd5478c0eb8edde"><div class="ttname"><a href="cube_8c.html#ad89af5ea893ea45fdcd5478c0eb8edde">demo_init_connection</a></div><div class="ttdeci">static void demo_init_connection(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l03567">cube.c:3567</a></div></div>
<div class="ttc" id="structdemo_html_a3019e8f64270299a805d852340e64916"><div class="ttname"><a href="structdemo.html#a3019e8f64270299a805d852340e64916">demo::validate_checks_disabled</a></div><div class="ttdeci">bool validate_checks_disabled</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00436">cube.c:436</a></div></div>
<div class="ttc" id="structdemo_html_a812091c8a029af03be7dfac45fbaadad"><div class="ttname"><a href="structdemo.html#a812091c8a029af03be7dfac45fbaadad">demo::presentMode</a></div><div class="ttdeci">VkPresentModeKHR presentMode</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00393">cube.c:393</a></div></div>
<div class="ttc" id="structdemo_html_a79020e20ddd6a4fe9bc9489a12d05696"><div class="ttname"><a href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">demo::width</a></div><div class="ttdeci">int width</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="cube_8c_html_ab5541e08a357bb88cd008693b6ffc6db"><div class="ttname"><a href="cube_8c.html#ab5541e08a357bb88cd008693b6ffc6db">APP_SHORT_NAME</a></div><div class="ttdeci">#define APP_SHORT_NAME</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00067">cube.c:67</a></div></div>
<div class="ttc" id="cube_8c_html_a28fe14fddb8a99da1b8a644308d1a901"><div class="ttname"><a href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a></div><div class="ttdeci">#define ERR_EXIT(err_msg, err_class)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00123">cube.c:123</a></div></div>
<div class="ttc" id="structdemo_html_a3042e9d9a2afa521340ebb55b09e93ef"><div class="ttname"><a href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">demo::validate</a></div><div class="ttdeci">bool validate</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00435">cube.c:435</a></div></div>
<div class="ttc" id="structdemo_html_ae7f8cd202364dbe492a9bdb47e52c6d6"><div class="ttname"><a href="structdemo.html#ae7f8cd202364dbe492a9bdb47e52c6d6">demo::model_matrix</a></div><div class="ttdeci">mat4x4 model_matrix</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00421">cube.c:421</a></div></div>
<div class="ttc" id="structdemo_html_af6a82a8de928dd783df9cde04533e84d"><div class="ttname"><a href="structdemo.html#af6a82a8de928dd783df9cde04533e84d">demo::use_staging_buffer</a></div><div class="ttdeci">bool use_staging_buffer</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00340">cube.c:340</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a9614fd51f6e418355a34964db328d781_cgraph.png" border="0" usemap="#cube_8c_a9614fd51f6e418355a34964db328d781_cgraph" alt=""/></div>
<map name="cube_8c_a9614fd51f6e418355a34964db328d781_cgraph" id="cube_8c_a9614fd51f6e418355a34964db328d781_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#ad89af5ea893ea45fdcd5478c0eb8edde" title="demo_init_connection" alt="" coords="132,5,280,32"/>
<area shape="rect" id="node3" href="cube_8c.html#abdcd6d1f2fdbb957fd5c0337d86a286c" title="demo_init_vk" alt="" coords="157,56,255,83"/>
<area shape="rect" id="node4" href="cube_8c.html#abcfbf263b3a2885f094ece366b4c2a5b" title="demo_check_layers" alt="" coords="350,5,489,32"/>
<area shape="rect" id="node5" href="cube_8c.html#a47431f229fafc6047bb34487ee34151a" title="debug_messenger_callback" alt="" coords="328,56,511,83"/>
<area shape="rect" id="node6" href="cube_8c.html#a1714a35ca475fd30144cd4090d94d286" title="DbgMsg" alt="" coords="384,107,455,133"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a9614fd51f6e418355a34964db328d781_icgraph.png" border="0" usemap="#cube_8c_a9614fd51f6e418355a34964db328d781_icgraph" alt=""/></div>
<map name="cube_8c_a9614fd51f6e418355a34964db328d781_icgraph" id="cube_8c_a9614fd51f6e418355a34964db328d781_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="132,5,205,32"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ad89af5ea893ea45fdcd5478c0eb8edde"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_init_connection </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l03567">3567</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00308">demo::connection</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l03608">demo_init()</a>.</p>
<div class="fragment"><div class="line"><a name="l03567"></a><span class="lineno"> 3567</span>&#160;                                                    {</div><div class="line"><a name="l03568"></a><span class="lineno"> 3568</span>&#160;<span class="preprocessor">#if defined(VK_USE_PLATFORM_XCB_KHR)</span></div><div class="line"><a name="l03569"></a><span class="lineno"> 3569</span>&#160;    <span class="keyword">const</span> xcb_setup_t *setup;</div><div class="line"><a name="l03570"></a><span class="lineno"> 3570</span>&#160;    xcb_screen_iterator_t iter;</div><div class="line"><a name="l03571"></a><span class="lineno"> 3571</span>&#160;    <span class="keywordtype">int</span> scr;</div><div class="line"><a name="l03572"></a><span class="lineno"> 3572</span>&#160;</div><div class="line"><a name="l03573"></a><span class="lineno"> 3573</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *display_envar = getenv(<span class="stringliteral">&quot;DISPLAY&quot;</span>);</div><div class="line"><a name="l03574"></a><span class="lineno"> 3574</span>&#160;    <span class="keywordflow">if</span> (display_envar == NULL || display_envar[0] == <span class="charliteral">&#39;\0&#39;</span>) {</div><div class="line"><a name="l03575"></a><span class="lineno"> 3575</span>&#160;        printf(<span class="stringliteral">&quot;Environment variable DISPLAY requires a valid value.\nExiting ...\n&quot;</span>);</div><div class="line"><a name="l03576"></a><span class="lineno"> 3576</span>&#160;        fflush(stdout);</div><div class="line"><a name="l03577"></a><span class="lineno"> 3577</span>&#160;        exit(1);</div><div class="line"><a name="l03578"></a><span class="lineno"> 3578</span>&#160;    }</div><div class="line"><a name="l03579"></a><span class="lineno"> 3579</span>&#160;</div><div class="line"><a name="l03580"></a><span class="lineno"> 3580</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a4f271161fb166d561f5da630dd0de222">connection</a> = xcb_connect(NULL, &amp;scr);</div><div class="line"><a name="l03581"></a><span class="lineno"> 3581</span>&#160;    <span class="keywordflow">if</span> (xcb_connection_has_error(demo-&gt;<a class="code" href="structdemo.html#a4f271161fb166d561f5da630dd0de222">connection</a>) &gt; 0) {</div><div class="line"><a name="l03582"></a><span class="lineno"> 3582</span>&#160;        printf(<span class="stringliteral">&quot;Cannot find a compatible Vulkan installable client driver (ICD).\nExiting ...\n&quot;</span>);</div><div class="line"><a name="l03583"></a><span class="lineno"> 3583</span>&#160;        fflush(stdout);</div><div class="line"><a name="l03584"></a><span class="lineno"> 3584</span>&#160;        exit(1);</div><div class="line"><a name="l03585"></a><span class="lineno"> 3585</span>&#160;    }</div><div class="line"><a name="l03586"></a><span class="lineno"> 3586</span>&#160;</div><div class="line"><a name="l03587"></a><span class="lineno"> 3587</span>&#160;    setup = xcb_get_setup(demo-&gt;<a class="code" href="structdemo.html#a4f271161fb166d561f5da630dd0de222">connection</a>);</div><div class="line"><a name="l03588"></a><span class="lineno"> 3588</span>&#160;    iter = xcb_setup_roots_iterator(setup);</div><div class="line"><a name="l03589"></a><span class="lineno"> 3589</span>&#160;    <span class="keywordflow">while</span> (scr-- &gt; 0) xcb_screen_next(&amp;iter);</div><div class="line"><a name="l03590"></a><span class="lineno"> 3590</span>&#160;</div><div class="line"><a name="l03591"></a><span class="lineno"> 3591</span>&#160;    demo-&gt;screen = iter.data;</div><div class="line"><a name="l03592"></a><span class="lineno"> 3592</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)</span></div><div class="line"><a name="l03593"></a><span class="lineno"> 3593</span>&#160;    demo-&gt;display = wl_display_connect(NULL);</div><div class="line"><a name="l03594"></a><span class="lineno"> 3594</span>&#160;</div><div class="line"><a name="l03595"></a><span class="lineno"> 3595</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;display == NULL) {</div><div class="line"><a name="l03596"></a><span class="lineno"> 3596</span>&#160;        printf(<span class="stringliteral">&quot;Cannot find a compatible Vulkan installable client driver (ICD).\nExiting ...\n&quot;</span>);</div><div class="line"><a name="l03597"></a><span class="lineno"> 3597</span>&#160;        fflush(stdout);</div><div class="line"><a name="l03598"></a><span class="lineno"> 3598</span>&#160;        exit(1);</div><div class="line"><a name="l03599"></a><span class="lineno"> 3599</span>&#160;    }</div><div class="line"><a name="l03600"></a><span class="lineno"> 3600</span>&#160;</div><div class="line"><a name="l03601"></a><span class="lineno"> 3601</span>&#160;    demo-&gt;registry = wl_display_get_registry(demo-&gt;display);</div><div class="line"><a name="l03602"></a><span class="lineno"> 3602</span>&#160;    wl_registry_add_listener(demo-&gt;registry, &amp;registry_listener, demo);</div><div class="line"><a name="l03603"></a><span class="lineno"> 3603</span>&#160;    wl_display_dispatch(demo-&gt;display);</div><div class="line"><a name="l03604"></a><span class="lineno"> 3604</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_MIR_KHR)</span></div><div class="line"><a name="l03605"></a><span class="lineno"> 3605</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l03606"></a><span class="lineno"> 3606</span>&#160;}</div><div class="ttc" id="structdemo_html_a4f271161fb166d561f5da630dd0de222"><div class="ttname"><a href="structdemo.html#a4f271161fb166d561f5da630dd0de222">demo::connection</a></div><div class="ttdeci">HINSTANCE connection</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00308">cube.c:308</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ad89af5ea893ea45fdcd5478c0eb8edde_icgraph.png" border="0" usemap="#cube_8c_ad89af5ea893ea45fdcd5478c0eb8edde_icgraph" alt=""/></div>
<map name="cube_8c_ad89af5ea893ea45fdcd5478c0eb8edde_icgraph" id="cube_8c_ad89af5ea893ea45fdcd5478c0eb8edde_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a9614fd51f6e418355a34964db328d781" title="demo_init" alt="" coords="201,5,280,32"/>
<area shape="rect" id="node3" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="328,5,401,32"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="abdcd6d1f2fdbb957fd5c0337d86a286c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_init_vk </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l02849">2849</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00067">APP_SHORT_NAME</a>, <a class="el" href="cube_8c_source.html#l00073">ARRAY_SIZE</a>, <a class="el" href="cube_8c_source.html#l00397">demo::cmd_pool</a>, <a class="el" href="cube_8c_source.html#l00443">demo::CmdBeginDebugUtilsLabelEXT</a>, <a class="el" href="cube_8c_source.html#l00444">demo::CmdEndDebugUtilsLabelEXT</a>, <a class="el" href="cube_8c_source.html#l00445">demo::CmdInsertDebugUtilsLabelEXT</a>, <a class="el" href="cube_8c_source.html#l00440">demo::CreateDebugUtilsMessengerEXT</a>, <a class="el" href="cube_8c_source.html#l00447">demo::dbg_messenger</a>, <a class="el" href="cube_8c_source.html#l00129">DbgMsg()</a>, <a class="el" href="cube_8c_source.html#l00453">debug_messenger_callback()</a>, <a class="el" href="cube_8c_source.html#l02341">demo</a>, <a class="el" href="cube_8c_source.html#l02832">demo_check_layers()</a>, <a class="el" href="cube_8c_source.html#l00441">demo::DestroyDebugUtilsMessengerEXT</a>, <a class="el" href="cube_8c_source.html#l00370">demo::enabled_extension_count</a>, <a class="el" href="cube_8c_source.html#l00371">demo::enabled_layer_count</a>, <a class="el" href="cube_8c_source.html#l00373">demo::enabled_layers</a>, <a class="el" href="cube_8c_source.html#l00123">ERR_EXIT</a>, <a class="el" href="cube_8c_source.html#l00372">demo::extension_names</a>, <a class="el" href="cube_8c_source.html#l00138">GET_INSTANCE_PROC_ADDR</a>, <a class="el" href="cube_8c_source.html#l00357">demo::gpu</a>, <a class="el" href="cube_8c_source.html#l00366">demo::gpu_props</a>, <a class="el" href="cube_8c_source.html#l00356">demo::inst</a>, <a class="el" href="cube_8c_source.html#l00342">demo::is_minimized</a>, <a class="el" href="cube_8c_source.html#l00450">demo::queue_family_count</a>, <a class="el" href="cube_8c_source.html#l00367">demo::queue_props</a>, <a class="el" href="cube_8c_source.html#l00446">demo::SetDebugUtilsObjectNameEXT</a>, <a class="el" href="cube_8c_source.html#l00442">demo::SubmitDebugUtilsMessageEXT</a>, <a class="el" href="cube_8c_source.html#l00435">demo::validate</a>, <a class="el" href="cube_8c_source.html#l00346">demo::VK_GOOGLE_display_timing_enabled</a>, and <a class="el" href="cube_8c_source.html#l00344">demo::VK_KHR_incremental_present_enabled</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l03608">demo_init()</a>.</p>
<div class="fragment"><div class="line"><a name="l02849"></a><span class="lineno"> 2849</span>&#160;                                            {</div><div class="line"><a name="l02850"></a><span class="lineno"> 2850</span>&#160;    VkResult err;</div><div class="line"><a name="l02851"></a><span class="lineno"> 2851</span>&#160;    uint32_t instance_extension_count = 0;</div><div class="line"><a name="l02852"></a><span class="lineno"> 2852</span>&#160;    uint32_t instance_layer_count = 0;</div><div class="line"><a name="l02853"></a><span class="lineno"> 2853</span>&#160;    uint32_t validation_layer_count = 0;</div><div class="line"><a name="l02854"></a><span class="lineno"> 2854</span>&#160;    <span class="keywordtype">char</span> **instance_validation_layers = NULL;</div><div class="line"><a name="l02855"></a><span class="lineno"> 2855</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a> = 0;</div><div class="line"><a name="l02856"></a><span class="lineno"> 2856</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a4334cd49fe358dae74dd74cfc2524b7a">enabled_layer_count</a> = 0;</div><div class="line"><a name="l02857"></a><span class="lineno"> 2857</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#ac2570a83ce706add3b8a07673237f30c">is_minimized</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l02858"></a><span class="lineno"> 2858</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#af527d51e6fafb65fec23e3b95b622b93">cmd_pool</a> = VK_NULL_HANDLE;</div><div class="line"><a name="l02859"></a><span class="lineno"> 2859</span>&#160;</div><div class="line"><a name="l02860"></a><span class="lineno"> 2860</span>&#160;    <span class="keywordtype">char</span> *instance_validation_layers_alt1[] = {<span class="stringliteral">&quot;VK_LAYER_LUNARG_standard_validation&quot;</span>};</div><div class="line"><a name="l02861"></a><span class="lineno"> 2861</span>&#160;</div><div class="line"><a name="l02862"></a><span class="lineno"> 2862</span>&#160;    <span class="keywordtype">char</span> *instance_validation_layers_alt2[] = {<span class="stringliteral">&quot;VK_LAYER_GOOGLE_threading&quot;</span>, <span class="stringliteral">&quot;VK_LAYER_LUNARG_parameter_validation&quot;</span>,</div><div class="line"><a name="l02863"></a><span class="lineno"> 2863</span>&#160;                                               <span class="stringliteral">&quot;VK_LAYER_LUNARG_object_tracker&quot;</span>, <span class="stringliteral">&quot;VK_LAYER_LUNARG_core_validation&quot;</span>,</div><div class="line"><a name="l02864"></a><span class="lineno"> 2864</span>&#160;                                               <span class="stringliteral">&quot;VK_LAYER_GOOGLE_unique_objects&quot;</span>};</div><div class="line"><a name="l02865"></a><span class="lineno"> 2865</span>&#160;</div><div class="line"><a name="l02866"></a><span class="lineno"> 2866</span>&#160;    <span class="comment">/* Look for validation layers */</span></div><div class="line"><a name="l02867"></a><span class="lineno"> 2867</span>&#160;    VkBool32 validation_found = 0;</div><div class="line"><a name="l02868"></a><span class="lineno"> 2868</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">validate</a>) {</div><div class="line"><a name="l02869"></a><span class="lineno"> 2869</span>&#160;        err = vkEnumerateInstanceLayerProperties(&amp;instance_layer_count, NULL);</div><div class="line"><a name="l02870"></a><span class="lineno"> 2870</span>&#160;        assert(!err);</div><div class="line"><a name="l02871"></a><span class="lineno"> 2871</span>&#160;</div><div class="line"><a name="l02872"></a><span class="lineno"> 2872</span>&#160;        instance_validation_layers = instance_validation_layers_alt1;</div><div class="line"><a name="l02873"></a><span class="lineno"> 2873</span>&#160;        <span class="keywordflow">if</span> (instance_layer_count &gt; 0) {</div><div class="line"><a name="l02874"></a><span class="lineno"> 2874</span>&#160;            VkLayerProperties *instance_layers = malloc(<span class="keyword">sizeof</span>(VkLayerProperties) * instance_layer_count);</div><div class="line"><a name="l02875"></a><span class="lineno"> 2875</span>&#160;            err = vkEnumerateInstanceLayerProperties(&amp;instance_layer_count, instance_layers);</div><div class="line"><a name="l02876"></a><span class="lineno"> 2876</span>&#160;            assert(!err);</div><div class="line"><a name="l02877"></a><span class="lineno"> 2877</span>&#160;</div><div class="line"><a name="l02878"></a><span class="lineno"> 2878</span>&#160;            validation_found = <a class="code" href="cube_8c.html#abcfbf263b3a2885f094ece366b4c2a5b">demo_check_layers</a>(<a class="code" href="cube_8c.html#a25f003de16c08a4888b69f619d70f427">ARRAY_SIZE</a>(instance_validation_layers_alt1), instance_validation_layers,</div><div class="line"><a name="l02879"></a><span class="lineno"> 2879</span>&#160;                                                 instance_layer_count, instance_layers);</div><div class="line"><a name="l02880"></a><span class="lineno"> 2880</span>&#160;            <span class="keywordflow">if</span> (validation_found) {</div><div class="line"><a name="l02881"></a><span class="lineno"> 2881</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a4334cd49fe358dae74dd74cfc2524b7a">enabled_layer_count</a> = <a class="code" href="cube_8c.html#a25f003de16c08a4888b69f619d70f427">ARRAY_SIZE</a>(instance_validation_layers_alt1);</div><div class="line"><a name="l02882"></a><span class="lineno"> 2882</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a8e7e12324626b9eae882d453b8abbe0c">enabled_layers</a>[0] = <span class="stringliteral">&quot;VK_LAYER_LUNARG_standard_validation&quot;</span>;</div><div class="line"><a name="l02883"></a><span class="lineno"> 2883</span>&#160;                validation_layer_count = 1;</div><div class="line"><a name="l02884"></a><span class="lineno"> 2884</span>&#160;            } <span class="keywordflow">else</span> {</div><div class="line"><a name="l02885"></a><span class="lineno"> 2885</span>&#160;                <span class="comment">// use alternative set of validation layers</span></div><div class="line"><a name="l02886"></a><span class="lineno"> 2886</span>&#160;                instance_validation_layers = instance_validation_layers_alt2;</div><div class="line"><a name="l02887"></a><span class="lineno"> 2887</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a4334cd49fe358dae74dd74cfc2524b7a">enabled_layer_count</a> = <a class="code" href="cube_8c.html#a25f003de16c08a4888b69f619d70f427">ARRAY_SIZE</a>(instance_validation_layers_alt2);</div><div class="line"><a name="l02888"></a><span class="lineno"> 2888</span>&#160;                validation_found = <a class="code" href="cube_8c.html#abcfbf263b3a2885f094ece366b4c2a5b">demo_check_layers</a>(<a class="code" href="cube_8c.html#a25f003de16c08a4888b69f619d70f427">ARRAY_SIZE</a>(instance_validation_layers_alt2), instance_validation_layers,</div><div class="line"><a name="l02889"></a><span class="lineno"> 2889</span>&#160;                                                     instance_layer_count, instance_layers);</div><div class="line"><a name="l02890"></a><span class="lineno"> 2890</span>&#160;                validation_layer_count = <a class="code" href="cube_8c.html#a25f003de16c08a4888b69f619d70f427">ARRAY_SIZE</a>(instance_validation_layers_alt2);</div><div class="line"><a name="l02891"></a><span class="lineno"> 2891</span>&#160;                <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; validation_layer_count; i++) {</div><div class="line"><a name="l02892"></a><span class="lineno"> 2892</span>&#160;                    demo-&gt;<a class="code" href="structdemo.html#a8e7e12324626b9eae882d453b8abbe0c">enabled_layers</a>[i] = instance_validation_layers[i];</div><div class="line"><a name="l02893"></a><span class="lineno"> 2893</span>&#160;                }</div><div class="line"><a name="l02894"></a><span class="lineno"> 2894</span>&#160;            }</div><div class="line"><a name="l02895"></a><span class="lineno"> 2895</span>&#160;            free(instance_layers);</div><div class="line"><a name="l02896"></a><span class="lineno"> 2896</span>&#160;        }</div><div class="line"><a name="l02897"></a><span class="lineno"> 2897</span>&#160;</div><div class="line"><a name="l02898"></a><span class="lineno"> 2898</span>&#160;        <span class="keywordflow">if</span> (!validation_found) {</div><div class="line"><a name="l02899"></a><span class="lineno"> 2899</span>&#160;            <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(</div><div class="line"><a name="l02900"></a><span class="lineno"> 2900</span>&#160;                <span class="stringliteral">&quot;vkEnumerateInstanceLayerProperties failed to find required validation layer.\n\n&quot;</span></div><div class="line"><a name="l02901"></a><span class="lineno"> 2901</span>&#160;                <span class="stringliteral">&quot;Please look at the Getting Started guide for additional information.\n&quot;</span>,</div><div class="line"><a name="l02902"></a><span class="lineno"> 2902</span>&#160;                <span class="stringliteral">&quot;vkCreateInstance Failure&quot;</span>);</div><div class="line"><a name="l02903"></a><span class="lineno"> 2903</span>&#160;        }</div><div class="line"><a name="l02904"></a><span class="lineno"> 2904</span>&#160;    }</div><div class="line"><a name="l02905"></a><span class="lineno"> 2905</span>&#160;</div><div class="line"><a name="l02906"></a><span class="lineno"> 2906</span>&#160;    <span class="comment">/* Look for instance extensions */</span></div><div class="line"><a name="l02907"></a><span class="lineno"> 2907</span>&#160;    VkBool32 surfaceExtFound = 0;</div><div class="line"><a name="l02908"></a><span class="lineno"> 2908</span>&#160;    VkBool32 platformSurfaceExtFound = 0;</div><div class="line"><a name="l02909"></a><span class="lineno"> 2909</span>&#160;    memset(demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>, 0, <span class="keyword">sizeof</span>(demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>));</div><div class="line"><a name="l02910"></a><span class="lineno"> 2910</span>&#160;</div><div class="line"><a name="l02911"></a><span class="lineno"> 2911</span>&#160;    err = vkEnumerateInstanceExtensionProperties(NULL, &amp;instance_extension_count, NULL);</div><div class="line"><a name="l02912"></a><span class="lineno"> 2912</span>&#160;    assert(!err);</div><div class="line"><a name="l02913"></a><span class="lineno"> 2913</span>&#160;</div><div class="line"><a name="l02914"></a><span class="lineno"> 2914</span>&#160;    <span class="keywordflow">if</span> (instance_extension_count &gt; 0) {</div><div class="line"><a name="l02915"></a><span class="lineno"> 2915</span>&#160;        VkExtensionProperties *instance_extensions = malloc(<span class="keyword">sizeof</span>(VkExtensionProperties) * instance_extension_count);</div><div class="line"><a name="l02916"></a><span class="lineno"> 2916</span>&#160;        err = vkEnumerateInstanceExtensionProperties(NULL, &amp;instance_extension_count, instance_extensions);</div><div class="line"><a name="l02917"></a><span class="lineno"> 2917</span>&#160;        assert(!err);</div><div class="line"><a name="l02918"></a><span class="lineno"> 2918</span>&#160;        <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; instance_extension_count; i++) {</div><div class="line"><a name="l02919"></a><span class="lineno"> 2919</span>&#160;            <span class="keywordflow">if</span> (!strcmp(VK_KHR_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) {</div><div class="line"><a name="l02920"></a><span class="lineno"> 2920</span>&#160;                surfaceExtFound = 1;</div><div class="line"><a name="l02921"></a><span class="lineno"> 2921</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>[demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a>++] = VK_KHR_SURFACE_EXTENSION_NAME;</div><div class="line"><a name="l02922"></a><span class="lineno"> 2922</span>&#160;            }</div><div class="line"><a name="l02923"></a><span class="lineno"> 2923</span>&#160;<span class="preprocessor">#if defined(VK_USE_PLATFORM_WIN32_KHR)</span></div><div class="line"><a name="l02924"></a><span class="lineno"> 2924</span>&#160;            <span class="keywordflow">if</span> (!strcmp(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) {</div><div class="line"><a name="l02925"></a><span class="lineno"> 2925</span>&#160;                platformSurfaceExtFound = 1;</div><div class="line"><a name="l02926"></a><span class="lineno"> 2926</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>[demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a>++] = VK_KHR_WIN32_SURFACE_EXTENSION_NAME;</div><div class="line"><a name="l02927"></a><span class="lineno"> 2927</span>&#160;            }</div><div class="line"><a name="l02928"></a><span class="lineno"> 2928</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_XLIB_KHR)</span></div><div class="line"><a name="l02929"></a><span class="lineno"> 2929</span>&#160;            <span class="keywordflow">if</span> (!strcmp(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) {</div><div class="line"><a name="l02930"></a><span class="lineno"> 2930</span>&#160;                platformSurfaceExtFound = 1;</div><div class="line"><a name="l02931"></a><span class="lineno"> 2931</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>[demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a>++] = VK_KHR_XLIB_SURFACE_EXTENSION_NAME;</div><div class="line"><a name="l02932"></a><span class="lineno"> 2932</span>&#160;            }</div><div class="line"><a name="l02933"></a><span class="lineno"> 2933</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_XCB_KHR)</span></div><div class="line"><a name="l02934"></a><span class="lineno"> 2934</span>&#160;            <span class="keywordflow">if</span> (!strcmp(VK_KHR_XCB_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) {</div><div class="line"><a name="l02935"></a><span class="lineno"> 2935</span>&#160;                platformSurfaceExtFound = 1;</div><div class="line"><a name="l02936"></a><span class="lineno"> 2936</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>[demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a>++] = VK_KHR_XCB_SURFACE_EXTENSION_NAME;</div><div class="line"><a name="l02937"></a><span class="lineno"> 2937</span>&#160;            }</div><div class="line"><a name="l02938"></a><span class="lineno"> 2938</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)</span></div><div class="line"><a name="l02939"></a><span class="lineno"> 2939</span>&#160;            <span class="keywordflow">if</span> (!strcmp(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) {</div><div class="line"><a name="l02940"></a><span class="lineno"> 2940</span>&#160;                platformSurfaceExtFound = 1;</div><div class="line"><a name="l02941"></a><span class="lineno"> 2941</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>[demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a>++] = VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME;</div><div class="line"><a name="l02942"></a><span class="lineno"> 2942</span>&#160;            }</div><div class="line"><a name="l02943"></a><span class="lineno"> 2943</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_MIR_KHR)</span></div><div class="line"><a name="l02944"></a><span class="lineno"> 2944</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_DISPLAY_KHR)</span></div><div class="line"><a name="l02945"></a><span class="lineno"> 2945</span>&#160;            <span class="keywordflow">if</span> (!strcmp(VK_KHR_DISPLAY_EXTENSION_NAME, instance_extensions[i].extensionName)) {</div><div class="line"><a name="l02946"></a><span class="lineno"> 2946</span>&#160;                platformSurfaceExtFound = 1;</div><div class="line"><a name="l02947"></a><span class="lineno"> 2947</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>[demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a>++] = VK_KHR_DISPLAY_EXTENSION_NAME;</div><div class="line"><a name="l02948"></a><span class="lineno"> 2948</span>&#160;            }</div><div class="line"><a name="l02949"></a><span class="lineno"> 2949</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_ANDROID_KHR)</span></div><div class="line"><a name="l02950"></a><span class="lineno"> 2950</span>&#160;            <span class="keywordflow">if</span> (!strcmp(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) {</div><div class="line"><a name="l02951"></a><span class="lineno"> 2951</span>&#160;                platformSurfaceExtFound = 1;</div><div class="line"><a name="l02952"></a><span class="lineno"> 2952</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>[demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a>++] = VK_KHR_ANDROID_SURFACE_EXTENSION_NAME;</div><div class="line"><a name="l02953"></a><span class="lineno"> 2953</span>&#160;            }</div><div class="line"><a name="l02954"></a><span class="lineno"> 2954</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_IOS_MVK)</span></div><div class="line"><a name="l02955"></a><span class="lineno"> 2955</span>&#160;            <span class="keywordflow">if</span> (!strcmp(VK_MVK_IOS_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) {</div><div class="line"><a name="l02956"></a><span class="lineno"> 2956</span>&#160;                platformSurfaceExtFound = 1;</div><div class="line"><a name="l02957"></a><span class="lineno"> 2957</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>[demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a>++] = VK_MVK_IOS_SURFACE_EXTENSION_NAME;</div><div class="line"><a name="l02958"></a><span class="lineno"> 2958</span>&#160;            }</div><div class="line"><a name="l02959"></a><span class="lineno"> 2959</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_MACOS_MVK)</span></div><div class="line"><a name="l02960"></a><span class="lineno"> 2960</span>&#160;            <span class="keywordflow">if</span> (!strcmp(VK_MVK_MACOS_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) {</div><div class="line"><a name="l02961"></a><span class="lineno"> 2961</span>&#160;                platformSurfaceExtFound = 1;</div><div class="line"><a name="l02962"></a><span class="lineno"> 2962</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>[demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a>++] = VK_MVK_MACOS_SURFACE_EXTENSION_NAME;</div><div class="line"><a name="l02963"></a><span class="lineno"> 2963</span>&#160;            }</div><div class="line"><a name="l02964"></a><span class="lineno"> 2964</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l02965"></a><span class="lineno"> 2965</span>&#160;            <span class="keywordflow">if</span> (!strcmp(VK_EXT_DEBUG_UTILS_EXTENSION_NAME, instance_extensions[i].extensionName)) {</div><div class="line"><a name="l02966"></a><span class="lineno"> 2966</span>&#160;                <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">validate</a>) {</div><div class="line"><a name="l02967"></a><span class="lineno"> 2967</span>&#160;                    demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>[demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a>++] = VK_EXT_DEBUG_UTILS_EXTENSION_NAME;</div><div class="line"><a name="l02968"></a><span class="lineno"> 2968</span>&#160;                }</div><div class="line"><a name="l02969"></a><span class="lineno"> 2969</span>&#160;            }</div><div class="line"><a name="l02970"></a><span class="lineno"> 2970</span>&#160;            assert(demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a> &lt; 64);</div><div class="line"><a name="l02971"></a><span class="lineno"> 2971</span>&#160;        }</div><div class="line"><a name="l02972"></a><span class="lineno"> 2972</span>&#160;</div><div class="line"><a name="l02973"></a><span class="lineno"> 2973</span>&#160;        free(instance_extensions);</div><div class="line"><a name="l02974"></a><span class="lineno"> 2974</span>&#160;    }</div><div class="line"><a name="l02975"></a><span class="lineno"> 2975</span>&#160;</div><div class="line"><a name="l02976"></a><span class="lineno"> 2976</span>&#160;    <span class="keywordflow">if</span> (!surfaceExtFound) {</div><div class="line"><a name="l02977"></a><span class="lineno"> 2977</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;vkEnumerateInstanceExtensionProperties failed to find the &quot;</span> VK_KHR_SURFACE_EXTENSION_NAME</div><div class="line"><a name="l02978"></a><span class="lineno"> 2978</span>&#160;                 <span class="stringliteral">&quot; extension.\n\n&quot;</span></div><div class="line"><a name="l02979"></a><span class="lineno"> 2979</span>&#160;                 <span class="stringliteral">&quot;Do you have a compatible Vulkan installable client driver (ICD) installed?\n&quot;</span></div><div class="line"><a name="l02980"></a><span class="lineno"> 2980</span>&#160;                 <span class="stringliteral">&quot;Please look at the Getting Started guide for additional information.\n&quot;</span>,</div><div class="line"><a name="l02981"></a><span class="lineno"> 2981</span>&#160;                 <span class="stringliteral">&quot;vkCreateInstance Failure&quot;</span>);</div><div class="line"><a name="l02982"></a><span class="lineno"> 2982</span>&#160;    }</div><div class="line"><a name="l02983"></a><span class="lineno"> 2983</span>&#160;    <span class="keywordflow">if</span> (!platformSurfaceExtFound) {</div><div class="line"><a name="l02984"></a><span class="lineno"> 2984</span>&#160;<span class="preprocessor">#if defined(VK_USE_PLATFORM_WIN32_KHR)</span></div><div class="line"><a name="l02985"></a><span class="lineno"> 2985</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;vkEnumerateInstanceExtensionProperties failed to find the &quot;</span> VK_KHR_WIN32_SURFACE_EXTENSION_NAME</div><div class="line"><a name="l02986"></a><span class="lineno"> 2986</span>&#160;                 <span class="stringliteral">&quot; extension.\n\n&quot;</span></div><div class="line"><a name="l02987"></a><span class="lineno"> 2987</span>&#160;                 <span class="stringliteral">&quot;Do you have a compatible Vulkan installable client driver (ICD) installed?\n&quot;</span></div><div class="line"><a name="l02988"></a><span class="lineno"> 2988</span>&#160;                 <span class="stringliteral">&quot;Please look at the Getting Started guide for additional information.\n&quot;</span>,</div><div class="line"><a name="l02989"></a><span class="lineno"> 2989</span>&#160;                 <span class="stringliteral">&quot;vkCreateInstance Failure&quot;</span>);</div><div class="line"><a name="l02990"></a><span class="lineno"> 2990</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_IOS_MVK)</span></div><div class="line"><a name="l02991"></a><span class="lineno"> 2991</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;vkEnumerateInstanceExtensionProperties failed to find the &quot;</span> VK_MVK_IOS_SURFACE_EXTENSION_NAME</div><div class="line"><a name="l02992"></a><span class="lineno"> 2992</span>&#160;                 <span class="stringliteral">&quot; extension.\n\n&quot;</span></div><div class="line"><a name="l02993"></a><span class="lineno"> 2993</span>&#160;                 <span class="stringliteral">&quot;Do you have a compatible Vulkan installable client driver (ICD) installed?\n&quot;</span></div><div class="line"><a name="l02994"></a><span class="lineno"> 2994</span>&#160;                 <span class="stringliteral">&quot;Please look at the Getting Started guide for additional information.\n&quot;</span>,</div><div class="line"><a name="l02995"></a><span class="lineno"> 2995</span>&#160;                 <span class="stringliteral">&quot;vkCreateInstance Failure&quot;</span>);</div><div class="line"><a name="l02996"></a><span class="lineno"> 2996</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_MACOS_MVK)</span></div><div class="line"><a name="l02997"></a><span class="lineno"> 2997</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;vkEnumerateInstanceExtensionProperties failed to find the &quot;</span> VK_MVK_MACOS_SURFACE_EXTENSION_NAME</div><div class="line"><a name="l02998"></a><span class="lineno"> 2998</span>&#160;                 <span class="stringliteral">&quot; extension.\n\n&quot;</span></div><div class="line"><a name="l02999"></a><span class="lineno"> 2999</span>&#160;                 <span class="stringliteral">&quot;Do you have a compatible Vulkan installable client driver (ICD) installed?\n&quot;</span></div><div class="line"><a name="l03000"></a><span class="lineno"> 3000</span>&#160;                 <span class="stringliteral">&quot;Please look at the Getting Started guide for additional information.\n&quot;</span>,</div><div class="line"><a name="l03001"></a><span class="lineno"> 3001</span>&#160;                 <span class="stringliteral">&quot;vkCreateInstance Failure&quot;</span>);</div><div class="line"><a name="l03002"></a><span class="lineno"> 3002</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_XCB_KHR)</span></div><div class="line"><a name="l03003"></a><span class="lineno"> 3003</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;vkEnumerateInstanceExtensionProperties failed to find the &quot;</span> VK_KHR_XCB_SURFACE_EXTENSION_NAME</div><div class="line"><a name="l03004"></a><span class="lineno"> 3004</span>&#160;                 <span class="stringliteral">&quot; extension.\n\n&quot;</span></div><div class="line"><a name="l03005"></a><span class="lineno"> 3005</span>&#160;                 <span class="stringliteral">&quot;Do you have a compatible Vulkan installable client driver (ICD) installed?\n&quot;</span></div><div class="line"><a name="l03006"></a><span class="lineno"> 3006</span>&#160;                 <span class="stringliteral">&quot;Please look at the Getting Started guide for additional information.\n&quot;</span>,</div><div class="line"><a name="l03007"></a><span class="lineno"> 3007</span>&#160;                 <span class="stringliteral">&quot;vkCreateInstance Failure&quot;</span>);</div><div class="line"><a name="l03008"></a><span class="lineno"> 3008</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)</span></div><div class="line"><a name="l03009"></a><span class="lineno"> 3009</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;vkEnumerateInstanceExtensionProperties failed to find the &quot;</span> VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME</div><div class="line"><a name="l03010"></a><span class="lineno"> 3010</span>&#160;                 <span class="stringliteral">&quot; extension.\n\n&quot;</span></div><div class="line"><a name="l03011"></a><span class="lineno"> 3011</span>&#160;                 <span class="stringliteral">&quot;Do you have a compatible Vulkan installable client driver (ICD) installed?\n&quot;</span></div><div class="line"><a name="l03012"></a><span class="lineno"> 3012</span>&#160;                 <span class="stringliteral">&quot;Please look at the Getting Started guide for additional information.\n&quot;</span>,</div><div class="line"><a name="l03013"></a><span class="lineno"> 3013</span>&#160;                 <span class="stringliteral">&quot;vkCreateInstance Failure&quot;</span>);</div><div class="line"><a name="l03014"></a><span class="lineno"> 3014</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_MIR_KHR)</span></div><div class="line"><a name="l03015"></a><span class="lineno"> 3015</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_DISPLAY_KHR)</span></div><div class="line"><a name="l03016"></a><span class="lineno"> 3016</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;vkEnumerateInstanceExtensionProperties failed to find the &quot;</span> VK_KHR_DISPLAY_EXTENSION_NAME</div><div class="line"><a name="l03017"></a><span class="lineno"> 3017</span>&#160;                 <span class="stringliteral">&quot; extension.\n\n&quot;</span></div><div class="line"><a name="l03018"></a><span class="lineno"> 3018</span>&#160;                 <span class="stringliteral">&quot;Do you have a compatible Vulkan installable client driver (ICD) installed?\n&quot;</span></div><div class="line"><a name="l03019"></a><span class="lineno"> 3019</span>&#160;                 <span class="stringliteral">&quot;Please look at the Getting Started guide for additional information.\n&quot;</span>,</div><div class="line"><a name="l03020"></a><span class="lineno"> 3020</span>&#160;                 <span class="stringliteral">&quot;vkCreateInstance Failure&quot;</span>);</div><div class="line"><a name="l03021"></a><span class="lineno"> 3021</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_ANDROID_KHR)</span></div><div class="line"><a name="l03022"></a><span class="lineno"> 3022</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;vkEnumerateInstanceExtensionProperties failed to find the &quot;</span> VK_KHR_ANDROID_SURFACE_EXTENSION_NAME</div><div class="line"><a name="l03023"></a><span class="lineno"> 3023</span>&#160;                 <span class="stringliteral">&quot; extension.\n\n&quot;</span></div><div class="line"><a name="l03024"></a><span class="lineno"> 3024</span>&#160;                 <span class="stringliteral">&quot;Do you have a compatible Vulkan installable client driver (ICD) installed?\n&quot;</span></div><div class="line"><a name="l03025"></a><span class="lineno"> 3025</span>&#160;                 <span class="stringliteral">&quot;Please look at the Getting Started guide for additional information.\n&quot;</span>,</div><div class="line"><a name="l03026"></a><span class="lineno"> 3026</span>&#160;                 <span class="stringliteral">&quot;vkCreateInstance Failure&quot;</span>);</div><div class="line"><a name="l03027"></a><span class="lineno"> 3027</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_XLIB_KHR)</span></div><div class="line"><a name="l03028"></a><span class="lineno"> 3028</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;vkEnumerateInstanceExtensionProperties failed to find the &quot;</span> VK_KHR_XLIB_SURFACE_EXTENSION_NAME</div><div class="line"><a name="l03029"></a><span class="lineno"> 3029</span>&#160;                 <span class="stringliteral">&quot; extension.\n\n&quot;</span></div><div class="line"><a name="l03030"></a><span class="lineno"> 3030</span>&#160;                 <span class="stringliteral">&quot;Do you have a compatible Vulkan installable client driver (ICD) installed?\n&quot;</span></div><div class="line"><a name="l03031"></a><span class="lineno"> 3031</span>&#160;                 <span class="stringliteral">&quot;Please look at the Getting Started guide for additional information.\n&quot;</span>,</div><div class="line"><a name="l03032"></a><span class="lineno"> 3032</span>&#160;                 <span class="stringliteral">&quot;vkCreateInstance Failure&quot;</span>);</div><div class="line"><a name="l03033"></a><span class="lineno"> 3033</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l03034"></a><span class="lineno"> 3034</span>&#160;    }</div><div class="line"><a name="l03035"></a><span class="lineno"> 3035</span>&#160;    <span class="keyword">const</span> VkApplicationInfo app = {</div><div class="line"><a name="l03036"></a><span class="lineno"> 3036</span>&#160;        .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,</div><div class="line"><a name="l03037"></a><span class="lineno"> 3037</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l03038"></a><span class="lineno"> 3038</span>&#160;        .pApplicationName = <a class="code" href="cube_8c.html#ab5541e08a357bb88cd008693b6ffc6db">APP_SHORT_NAME</a>,</div><div class="line"><a name="l03039"></a><span class="lineno"> 3039</span>&#160;        .applicationVersion = 0,</div><div class="line"><a name="l03040"></a><span class="lineno"> 3040</span>&#160;        .pEngineName = <a class="code" href="cube_8c.html#ab5541e08a357bb88cd008693b6ffc6db">APP_SHORT_NAME</a>,</div><div class="line"><a name="l03041"></a><span class="lineno"> 3041</span>&#160;        .engineVersion = 0,</div><div class="line"><a name="l03042"></a><span class="lineno"> 3042</span>&#160;        .apiVersion = VK_API_VERSION_1_0,</div><div class="line"><a name="l03043"></a><span class="lineno"> 3043</span>&#160;    };</div><div class="line"><a name="l03044"></a><span class="lineno"> 3044</span>&#160;    VkInstanceCreateInfo inst_info = {</div><div class="line"><a name="l03045"></a><span class="lineno"> 3045</span>&#160;        .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,</div><div class="line"><a name="l03046"></a><span class="lineno"> 3046</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l03047"></a><span class="lineno"> 3047</span>&#160;        .pApplicationInfo = &amp;app,</div><div class="line"><a name="l03048"></a><span class="lineno"> 3048</span>&#160;        .enabledLayerCount = demo-&gt;<a class="code" href="structdemo.html#a4334cd49fe358dae74dd74cfc2524b7a">enabled_layer_count</a>,</div><div class="line"><a name="l03049"></a><span class="lineno"> 3049</span>&#160;        .ppEnabledLayerNames = (<span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> *)instance_validation_layers,</div><div class="line"><a name="l03050"></a><span class="lineno"> 3050</span>&#160;        .enabledExtensionCount = demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a>,</div><div class="line"><a name="l03051"></a><span class="lineno"> 3051</span>&#160;        .ppEnabledExtensionNames = (<span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> *)demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>,</div><div class="line"><a name="l03052"></a><span class="lineno"> 3052</span>&#160;    };</div><div class="line"><a name="l03053"></a><span class="lineno"> 3053</span>&#160;</div><div class="line"><a name="l03054"></a><span class="lineno"> 3054</span>&#160;    <span class="comment">/*</span></div><div class="line"><a name="l03055"></a><span class="lineno"> 3055</span>&#160;<span class="comment">     * This is info for a temp callback to use during CreateInstance.</span></div><div class="line"><a name="l03056"></a><span class="lineno"> 3056</span>&#160;<span class="comment">     * After the instance is created, we use the instance-based</span></div><div class="line"><a name="l03057"></a><span class="lineno"> 3057</span>&#160;<span class="comment">     * function to register the final callback.</span></div><div class="line"><a name="l03058"></a><span class="lineno"> 3058</span>&#160;<span class="comment">     */</span></div><div class="line"><a name="l03059"></a><span class="lineno"> 3059</span>&#160;    VkDebugUtilsMessengerCreateInfoEXT dbg_messenger_create_info;</div><div class="line"><a name="l03060"></a><span class="lineno"> 3060</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">validate</a>) {</div><div class="line"><a name="l03061"></a><span class="lineno"> 3061</span>&#160;        <span class="comment">// VK_EXT_debug_utils style</span></div><div class="line"><a name="l03062"></a><span class="lineno"> 3062</span>&#160;        dbg_messenger_create_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT;</div><div class="line"><a name="l03063"></a><span class="lineno"> 3063</span>&#160;        dbg_messenger_create_info.pNext = NULL;</div><div class="line"><a name="l03064"></a><span class="lineno"> 3064</span>&#160;        dbg_messenger_create_info.flags = 0;</div><div class="line"><a name="l03065"></a><span class="lineno"> 3065</span>&#160;        dbg_messenger_create_info.messageSeverity =</div><div class="line"><a name="l03066"></a><span class="lineno"> 3066</span>&#160;            VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT;</div><div class="line"><a name="l03067"></a><span class="lineno"> 3067</span>&#160;        dbg_messenger_create_info.messageType = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT |</div><div class="line"><a name="l03068"></a><span class="lineno"> 3068</span>&#160;                                                VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT |</div><div class="line"><a name="l03069"></a><span class="lineno"> 3069</span>&#160;                                                VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT;</div><div class="line"><a name="l03070"></a><span class="lineno"> 3070</span>&#160;        dbg_messenger_create_info.pfnUserCallback = <a class="code" href="cube_8c.html#a47431f229fafc6047bb34487ee34151a">debug_messenger_callback</a>;</div><div class="line"><a name="l03071"></a><span class="lineno"> 3071</span>&#160;        dbg_messenger_create_info.pUserData = <a class="code" href="cube_8c.html#a11282d06da34a669ccca5b1a9336c225">demo</a>;</div><div class="line"><a name="l03072"></a><span class="lineno"> 3072</span>&#160;        inst_info.pNext = &amp;dbg_messenger_create_info;</div><div class="line"><a name="l03073"></a><span class="lineno"> 3073</span>&#160;    }</div><div class="line"><a name="l03074"></a><span class="lineno"> 3074</span>&#160;</div><div class="line"><a name="l03075"></a><span class="lineno"> 3075</span>&#160;    uint32_t gpu_count;</div><div class="line"><a name="l03076"></a><span class="lineno"> 3076</span>&#160;</div><div class="line"><a name="l03077"></a><span class="lineno"> 3077</span>&#160;    err = vkCreateInstance(&amp;inst_info, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>);</div><div class="line"><a name="l03078"></a><span class="lineno"> 3078</span>&#160;    <span class="keywordflow">if</span> (err == VK_ERROR_INCOMPATIBLE_DRIVER) {</div><div class="line"><a name="l03079"></a><span class="lineno"> 3079</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(</div><div class="line"><a name="l03080"></a><span class="lineno"> 3080</span>&#160;            <span class="stringliteral">&quot;Cannot find a compatible Vulkan installable client driver (ICD).\n\n&quot;</span></div><div class="line"><a name="l03081"></a><span class="lineno"> 3081</span>&#160;            <span class="stringliteral">&quot;Please look at the Getting Started guide for additional information.\n&quot;</span>,</div><div class="line"><a name="l03082"></a><span class="lineno"> 3082</span>&#160;            <span class="stringliteral">&quot;vkCreateInstance Failure&quot;</span>);</div><div class="line"><a name="l03083"></a><span class="lineno"> 3083</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (err == VK_ERROR_EXTENSION_NOT_PRESENT) {</div><div class="line"><a name="l03084"></a><span class="lineno"> 3084</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(</div><div class="line"><a name="l03085"></a><span class="lineno"> 3085</span>&#160;            <span class="stringliteral">&quot;Cannot find a specified extension library.\n&quot;</span></div><div class="line"><a name="l03086"></a><span class="lineno"> 3086</span>&#160;            <span class="stringliteral">&quot;Make sure your layers path is set appropriately.\n&quot;</span>,</div><div class="line"><a name="l03087"></a><span class="lineno"> 3087</span>&#160;            <span class="stringliteral">&quot;vkCreateInstance Failure&quot;</span>);</div><div class="line"><a name="l03088"></a><span class="lineno"> 3088</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (err) {</div><div class="line"><a name="l03089"></a><span class="lineno"> 3089</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(</div><div class="line"><a name="l03090"></a><span class="lineno"> 3090</span>&#160;            <span class="stringliteral">&quot;vkCreateInstance failed.\n\n&quot;</span></div><div class="line"><a name="l03091"></a><span class="lineno"> 3091</span>&#160;            <span class="stringliteral">&quot;Do you have a compatible Vulkan installable client driver (ICD) installed?\n&quot;</span></div><div class="line"><a name="l03092"></a><span class="lineno"> 3092</span>&#160;            <span class="stringliteral">&quot;Please look at the Getting Started guide for additional information.\n&quot;</span>,</div><div class="line"><a name="l03093"></a><span class="lineno"> 3093</span>&#160;            <span class="stringliteral">&quot;vkCreateInstance Failure&quot;</span>);</div><div class="line"><a name="l03094"></a><span class="lineno"> 3094</span>&#160;    }</div><div class="line"><a name="l03095"></a><span class="lineno"> 3095</span>&#160;</div><div class="line"><a name="l03096"></a><span class="lineno"> 3096</span>&#160;    <span class="comment">/* Make initial call to query gpu_count, then second call for gpu info*/</span></div><div class="line"><a name="l03097"></a><span class="lineno"> 3097</span>&#160;    err = vkEnumeratePhysicalDevices(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, &amp;gpu_count, NULL);</div><div class="line"><a name="l03098"></a><span class="lineno"> 3098</span>&#160;    assert(!err);</div><div class="line"><a name="l03099"></a><span class="lineno"> 3099</span>&#160;</div><div class="line"><a name="l03100"></a><span class="lineno"> 3100</span>&#160;    <span class="keywordflow">if</span> (gpu_count &gt; 0) {</div><div class="line"><a name="l03101"></a><span class="lineno"> 3101</span>&#160;        VkPhysicalDevice *physical_devices = malloc(<span class="keyword">sizeof</span>(VkPhysicalDevice) * gpu_count);</div><div class="line"><a name="l03102"></a><span class="lineno"> 3102</span>&#160;        err = vkEnumeratePhysicalDevices(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, &amp;gpu_count, physical_devices);</div><div class="line"><a name="l03103"></a><span class="lineno"> 3103</span>&#160;        assert(!err);</div><div class="line"><a name="l03104"></a><span class="lineno"> 3104</span>&#160;        <span class="comment">/* For cube demo we just grab the first physical device */</span></div><div class="line"><a name="l03105"></a><span class="lineno"> 3105</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a> = physical_devices[0];</div><div class="line"><a name="l03106"></a><span class="lineno"> 3106</span>&#160;        free(physical_devices);</div><div class="line"><a name="l03107"></a><span class="lineno"> 3107</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l03108"></a><span class="lineno"> 3108</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(</div><div class="line"><a name="l03109"></a><span class="lineno"> 3109</span>&#160;            <span class="stringliteral">&quot;vkEnumeratePhysicalDevices reported zero accessible devices.\n\n&quot;</span></div><div class="line"><a name="l03110"></a><span class="lineno"> 3110</span>&#160;            <span class="stringliteral">&quot;Do you have a compatible Vulkan installable client driver (ICD) installed?\n&quot;</span></div><div class="line"><a name="l03111"></a><span class="lineno"> 3111</span>&#160;            <span class="stringliteral">&quot;Please look at the Getting Started guide for additional information.\n&quot;</span>,</div><div class="line"><a name="l03112"></a><span class="lineno"> 3112</span>&#160;            <span class="stringliteral">&quot;vkEnumeratePhysicalDevices Failure&quot;</span>);</div><div class="line"><a name="l03113"></a><span class="lineno"> 3113</span>&#160;    }</div><div class="line"><a name="l03114"></a><span class="lineno"> 3114</span>&#160;</div><div class="line"><a name="l03115"></a><span class="lineno"> 3115</span>&#160;    <span class="comment">/* Look for device extensions */</span></div><div class="line"><a name="l03116"></a><span class="lineno"> 3116</span>&#160;    uint32_t device_extension_count = 0;</div><div class="line"><a name="l03117"></a><span class="lineno"> 3117</span>&#160;    VkBool32 swapchainExtFound = 0;</div><div class="line"><a name="l03118"></a><span class="lineno"> 3118</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a> = 0;</div><div class="line"><a name="l03119"></a><span class="lineno"> 3119</span>&#160;    memset(demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>, 0, <span class="keyword">sizeof</span>(demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>));</div><div class="line"><a name="l03120"></a><span class="lineno"> 3120</span>&#160;</div><div class="line"><a name="l03121"></a><span class="lineno"> 3121</span>&#160;    err = vkEnumerateDeviceExtensionProperties(demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a>, NULL, &amp;device_extension_count, NULL);</div><div class="line"><a name="l03122"></a><span class="lineno"> 3122</span>&#160;    assert(!err);</div><div class="line"><a name="l03123"></a><span class="lineno"> 3123</span>&#160;</div><div class="line"><a name="l03124"></a><span class="lineno"> 3124</span>&#160;    <span class="keywordflow">if</span> (device_extension_count &gt; 0) {</div><div class="line"><a name="l03125"></a><span class="lineno"> 3125</span>&#160;        VkExtensionProperties *device_extensions = malloc(<span class="keyword">sizeof</span>(VkExtensionProperties) * device_extension_count);</div><div class="line"><a name="l03126"></a><span class="lineno"> 3126</span>&#160;        err = vkEnumerateDeviceExtensionProperties(demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a>, NULL, &amp;device_extension_count, device_extensions);</div><div class="line"><a name="l03127"></a><span class="lineno"> 3127</span>&#160;        assert(!err);</div><div class="line"><a name="l03128"></a><span class="lineno"> 3128</span>&#160;</div><div class="line"><a name="l03129"></a><span class="lineno"> 3129</span>&#160;        <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; device_extension_count; i++) {</div><div class="line"><a name="l03130"></a><span class="lineno"> 3130</span>&#160;            <span class="keywordflow">if</span> (!strcmp(VK_KHR_SWAPCHAIN_EXTENSION_NAME, device_extensions[i].extensionName)) {</div><div class="line"><a name="l03131"></a><span class="lineno"> 3131</span>&#160;                swapchainExtFound = 1;</div><div class="line"><a name="l03132"></a><span class="lineno"> 3132</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>[demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a>++] = VK_KHR_SWAPCHAIN_EXTENSION_NAME;</div><div class="line"><a name="l03133"></a><span class="lineno"> 3133</span>&#160;            }</div><div class="line"><a name="l03134"></a><span class="lineno"> 3134</span>&#160;            assert(demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a> &lt; 64);</div><div class="line"><a name="l03135"></a><span class="lineno"> 3135</span>&#160;        }</div><div class="line"><a name="l03136"></a><span class="lineno"> 3136</span>&#160;</div><div class="line"><a name="l03137"></a><span class="lineno"> 3137</span>&#160;        <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a07f0cd13803de3f7a2dcdb7274a448c3">VK_KHR_incremental_present_enabled</a>) {</div><div class="line"><a name="l03138"></a><span class="lineno"> 3138</span>&#160;            <span class="comment">// Even though the user &quot;enabled&quot; the extension via the command</span></div><div class="line"><a name="l03139"></a><span class="lineno"> 3139</span>&#160;            <span class="comment">// line, we must make sure that it&#39;s enumerated for use with the</span></div><div class="line"><a name="l03140"></a><span class="lineno"> 3140</span>&#160;            <span class="comment">// device.  Therefore, disable it here, and re-enable it again if</span></div><div class="line"><a name="l03141"></a><span class="lineno"> 3141</span>&#160;            <span class="comment">// enumerated.</span></div><div class="line"><a name="l03142"></a><span class="lineno"> 3142</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#a07f0cd13803de3f7a2dcdb7274a448c3">VK_KHR_incremental_present_enabled</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l03143"></a><span class="lineno"> 3143</span>&#160;            <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; device_extension_count; i++) {</div><div class="line"><a name="l03144"></a><span class="lineno"> 3144</span>&#160;                <span class="keywordflow">if</span> (!strcmp(VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME, device_extensions[i].extensionName)) {</div><div class="line"><a name="l03145"></a><span class="lineno"> 3145</span>&#160;                    demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>[demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a>++] = VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME;</div><div class="line"><a name="l03146"></a><span class="lineno"> 3146</span>&#160;                    demo-&gt;<a class="code" href="structdemo.html#a07f0cd13803de3f7a2dcdb7274a448c3">VK_KHR_incremental_present_enabled</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l03147"></a><span class="lineno"> 3147</span>&#160;                    <a class="code" href="cube_8c.html#a1714a35ca475fd30144cd4090d94d286">DbgMsg</a>(<span class="stringliteral">&quot;VK_KHR_incremental_present extension enabled\n&quot;</span>);</div><div class="line"><a name="l03148"></a><span class="lineno"> 3148</span>&#160;                }</div><div class="line"><a name="l03149"></a><span class="lineno"> 3149</span>&#160;                assert(demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a> &lt; 64);</div><div class="line"><a name="l03150"></a><span class="lineno"> 3150</span>&#160;            }</div><div class="line"><a name="l03151"></a><span class="lineno"> 3151</span>&#160;            <span class="keywordflow">if</span> (!demo-&gt;<a class="code" href="structdemo.html#a07f0cd13803de3f7a2dcdb7274a448c3">VK_KHR_incremental_present_enabled</a>) {</div><div class="line"><a name="l03152"></a><span class="lineno"> 3152</span>&#160;                <a class="code" href="cube_8c.html#a1714a35ca475fd30144cd4090d94d286">DbgMsg</a>(<span class="stringliteral">&quot;VK_KHR_incremental_present extension NOT AVAILABLE\n&quot;</span>);</div><div class="line"><a name="l03153"></a><span class="lineno"> 3153</span>&#160;            }</div><div class="line"><a name="l03154"></a><span class="lineno"> 3154</span>&#160;        }</div><div class="line"><a name="l03155"></a><span class="lineno"> 3155</span>&#160;</div><div class="line"><a name="l03156"></a><span class="lineno"> 3156</span>&#160;        <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a31e84ca0ec847d04922fa8d1b9efacb7">VK_GOOGLE_display_timing_enabled</a>) {</div><div class="line"><a name="l03157"></a><span class="lineno"> 3157</span>&#160;            <span class="comment">// Even though the user &quot;enabled&quot; the extension via the command</span></div><div class="line"><a name="l03158"></a><span class="lineno"> 3158</span>&#160;            <span class="comment">// line, we must make sure that it&#39;s enumerated for use with the</span></div><div class="line"><a name="l03159"></a><span class="lineno"> 3159</span>&#160;            <span class="comment">// device.  Therefore, disable it here, and re-enable it again if</span></div><div class="line"><a name="l03160"></a><span class="lineno"> 3160</span>&#160;            <span class="comment">// enumerated.</span></div><div class="line"><a name="l03161"></a><span class="lineno"> 3161</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#a31e84ca0ec847d04922fa8d1b9efacb7">VK_GOOGLE_display_timing_enabled</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l03162"></a><span class="lineno"> 3162</span>&#160;            <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; device_extension_count; i++) {</div><div class="line"><a name="l03163"></a><span class="lineno"> 3163</span>&#160;                <span class="keywordflow">if</span> (!strcmp(VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME, device_extensions[i].extensionName)) {</div><div class="line"><a name="l03164"></a><span class="lineno"> 3164</span>&#160;                    demo-&gt;<a class="code" href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">extension_names</a>[demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a>++] = VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME;</div><div class="line"><a name="l03165"></a><span class="lineno"> 3165</span>&#160;                    demo-&gt;<a class="code" href="structdemo.html#a31e84ca0ec847d04922fa8d1b9efacb7">VK_GOOGLE_display_timing_enabled</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l03166"></a><span class="lineno"> 3166</span>&#160;                    <a class="code" href="cube_8c.html#a1714a35ca475fd30144cd4090d94d286">DbgMsg</a>(<span class="stringliteral">&quot;VK_GOOGLE_display_timing extension enabled\n&quot;</span>);</div><div class="line"><a name="l03167"></a><span class="lineno"> 3167</span>&#160;                }</div><div class="line"><a name="l03168"></a><span class="lineno"> 3168</span>&#160;                assert(demo-&gt;<a class="code" href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">enabled_extension_count</a> &lt; 64);</div><div class="line"><a name="l03169"></a><span class="lineno"> 3169</span>&#160;            }</div><div class="line"><a name="l03170"></a><span class="lineno"> 3170</span>&#160;            <span class="keywordflow">if</span> (!demo-&gt;<a class="code" href="structdemo.html#a31e84ca0ec847d04922fa8d1b9efacb7">VK_GOOGLE_display_timing_enabled</a>) {</div><div class="line"><a name="l03171"></a><span class="lineno"> 3171</span>&#160;                <a class="code" href="cube_8c.html#a1714a35ca475fd30144cd4090d94d286">DbgMsg</a>(<span class="stringliteral">&quot;VK_GOOGLE_display_timing extension NOT AVAILABLE\n&quot;</span>);</div><div class="line"><a name="l03172"></a><span class="lineno"> 3172</span>&#160;            }</div><div class="line"><a name="l03173"></a><span class="lineno"> 3173</span>&#160;        }</div><div class="line"><a name="l03174"></a><span class="lineno"> 3174</span>&#160;</div><div class="line"><a name="l03175"></a><span class="lineno"> 3175</span>&#160;        free(device_extensions);</div><div class="line"><a name="l03176"></a><span class="lineno"> 3176</span>&#160;    }</div><div class="line"><a name="l03177"></a><span class="lineno"> 3177</span>&#160;</div><div class="line"><a name="l03178"></a><span class="lineno"> 3178</span>&#160;    <span class="keywordflow">if</span> (!swapchainExtFound) {</div><div class="line"><a name="l03179"></a><span class="lineno"> 3179</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;vkEnumerateDeviceExtensionProperties failed to find the &quot;</span> VK_KHR_SWAPCHAIN_EXTENSION_NAME</div><div class="line"><a name="l03180"></a><span class="lineno"> 3180</span>&#160;                 <span class="stringliteral">&quot; extension.\n\nDo you have a compatible Vulkan installable client driver (ICD) installed?\n&quot;</span></div><div class="line"><a name="l03181"></a><span class="lineno"> 3181</span>&#160;                 <span class="stringliteral">&quot;Please look at the Getting Started guide for additional information.\n&quot;</span>,</div><div class="line"><a name="l03182"></a><span class="lineno"> 3182</span>&#160;                 <span class="stringliteral">&quot;vkCreateInstance Failure&quot;</span>);</div><div class="line"><a name="l03183"></a><span class="lineno"> 3183</span>&#160;    }</div><div class="line"><a name="l03184"></a><span class="lineno"> 3184</span>&#160;</div><div class="line"><a name="l03185"></a><span class="lineno"> 3185</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">validate</a>) {</div><div class="line"><a name="l03186"></a><span class="lineno"> 3186</span>&#160;        <span class="comment">// Setup VK_EXT_debug_utils function pointers always (we use them for</span></div><div class="line"><a name="l03187"></a><span class="lineno"> 3187</span>&#160;        <span class="comment">// debug labels and names).</span></div><div class="line"><a name="l03188"></a><span class="lineno"> 3188</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a9dda601b5bcc75193406a5e6aeda0553">CreateDebugUtilsMessengerEXT</a> =</div><div class="line"><a name="l03189"></a><span class="lineno"> 3189</span>&#160;            (PFN_vkCreateDebugUtilsMessengerEXT)vkGetInstanceProcAddr(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, <span class="stringliteral">&quot;vkCreateDebugUtilsMessengerEXT&quot;</span>);</div><div class="line"><a name="l03190"></a><span class="lineno"> 3190</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#adcae8daa6e7a30ad72ff6af6207e4add">DestroyDebugUtilsMessengerEXT</a> =</div><div class="line"><a name="l03191"></a><span class="lineno"> 3191</span>&#160;            (PFN_vkDestroyDebugUtilsMessengerEXT)vkGetInstanceProcAddr(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, <span class="stringliteral">&quot;vkDestroyDebugUtilsMessengerEXT&quot;</span>);</div><div class="line"><a name="l03192"></a><span class="lineno"> 3192</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#aee1622f529b876ea0dcdcaadc798beda">SubmitDebugUtilsMessageEXT</a> =</div><div class="line"><a name="l03193"></a><span class="lineno"> 3193</span>&#160;            (PFN_vkSubmitDebugUtilsMessageEXT)vkGetInstanceProcAddr(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, <span class="stringliteral">&quot;vkSubmitDebugUtilsMessageEXT&quot;</span>);</div><div class="line"><a name="l03194"></a><span class="lineno"> 3194</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a9063cdb946b5e9b2112a31724681a8c2">CmdBeginDebugUtilsLabelEXT</a> =</div><div class="line"><a name="l03195"></a><span class="lineno"> 3195</span>&#160;            (PFN_vkCmdBeginDebugUtilsLabelEXT)vkGetInstanceProcAddr(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, <span class="stringliteral">&quot;vkCmdBeginDebugUtilsLabelEXT&quot;</span>);</div><div class="line"><a name="l03196"></a><span class="lineno"> 3196</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#ae106507a5332203027ae225fb648ab5f">CmdEndDebugUtilsLabelEXT</a> =</div><div class="line"><a name="l03197"></a><span class="lineno"> 3197</span>&#160;            (PFN_vkCmdEndDebugUtilsLabelEXT)vkGetInstanceProcAddr(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, <span class="stringliteral">&quot;vkCmdEndDebugUtilsLabelEXT&quot;</span>);</div><div class="line"><a name="l03198"></a><span class="lineno"> 3198</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a9cea495b9ff54d3ba78e686d4f5b3a99">CmdInsertDebugUtilsLabelEXT</a> =</div><div class="line"><a name="l03199"></a><span class="lineno"> 3199</span>&#160;            (PFN_vkCmdInsertDebugUtilsLabelEXT)vkGetInstanceProcAddr(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, <span class="stringliteral">&quot;vkCmdInsertDebugUtilsLabelEXT&quot;</span>);</div><div class="line"><a name="l03200"></a><span class="lineno"> 3200</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a5687f3f32029a20c4b148c7d23f8134d">SetDebugUtilsObjectNameEXT</a> =</div><div class="line"><a name="l03201"></a><span class="lineno"> 3201</span>&#160;            (PFN_vkSetDebugUtilsObjectNameEXT)vkGetInstanceProcAddr(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, <span class="stringliteral">&quot;vkSetDebugUtilsObjectNameEXT&quot;</span>);</div><div class="line"><a name="l03202"></a><span class="lineno"> 3202</span>&#160;        <span class="keywordflow">if</span> (NULL == demo-&gt;<a class="code" href="structdemo.html#a9dda601b5bcc75193406a5e6aeda0553">CreateDebugUtilsMessengerEXT</a> || NULL == demo-&gt;<a class="code" href="structdemo.html#adcae8daa6e7a30ad72ff6af6207e4add">DestroyDebugUtilsMessengerEXT</a> ||</div><div class="line"><a name="l03203"></a><span class="lineno"> 3203</span>&#160;            NULL == demo-&gt;<a class="code" href="structdemo.html#aee1622f529b876ea0dcdcaadc798beda">SubmitDebugUtilsMessageEXT</a> || NULL == demo-&gt;<a class="code" href="structdemo.html#a9063cdb946b5e9b2112a31724681a8c2">CmdBeginDebugUtilsLabelEXT</a> ||</div><div class="line"><a name="l03204"></a><span class="lineno"> 3204</span>&#160;            NULL == demo-&gt;<a class="code" href="structdemo.html#ae106507a5332203027ae225fb648ab5f">CmdEndDebugUtilsLabelEXT</a> || NULL == demo-&gt;<a class="code" href="structdemo.html#a9cea495b9ff54d3ba78e686d4f5b3a99">CmdInsertDebugUtilsLabelEXT</a> ||</div><div class="line"><a name="l03205"></a><span class="lineno"> 3205</span>&#160;            NULL == demo-&gt;<a class="code" href="structdemo.html#a5687f3f32029a20c4b148c7d23f8134d">SetDebugUtilsObjectNameEXT</a>) {</div><div class="line"><a name="l03206"></a><span class="lineno"> 3206</span>&#160;            <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;GetProcAddr: Failed to init VK_EXT_debug_utils\n&quot;</span>, <span class="stringliteral">&quot;GetProcAddr: Failure&quot;</span>);</div><div class="line"><a name="l03207"></a><span class="lineno"> 3207</span>&#160;        }</div><div class="line"><a name="l03208"></a><span class="lineno"> 3208</span>&#160;</div><div class="line"><a name="l03209"></a><span class="lineno"> 3209</span>&#160;        err = demo-&gt;<a class="code" href="structdemo.html#a9dda601b5bcc75193406a5e6aeda0553">CreateDebugUtilsMessengerEXT</a>(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, &amp;dbg_messenger_create_info, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#ab35e8474d7bb46e41e1fa0a07593c977">dbg_messenger</a>);</div><div class="line"><a name="l03210"></a><span class="lineno"> 3210</span>&#160;        <span class="keywordflow">switch</span> (err) {</div><div class="line"><a name="l03211"></a><span class="lineno"> 3211</span>&#160;            <span class="keywordflow">case</span> VK_SUCCESS:</div><div class="line"><a name="l03212"></a><span class="lineno"> 3212</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l03213"></a><span class="lineno"> 3213</span>&#160;            <span class="keywordflow">case</span> VK_ERROR_OUT_OF_HOST_MEMORY:</div><div class="line"><a name="l03214"></a><span class="lineno"> 3214</span>&#160;                <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;CreateDebugUtilsMessengerEXT: out of host memory\n&quot;</span>, <span class="stringliteral">&quot;CreateDebugUtilsMessengerEXT Failure&quot;</span>);</div><div class="line"><a name="l03215"></a><span class="lineno"> 3215</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l03216"></a><span class="lineno"> 3216</span>&#160;            <span class="keywordflow">default</span>:</div><div class="line"><a name="l03217"></a><span class="lineno"> 3217</span>&#160;                <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;CreateDebugUtilsMessengerEXT: unknown failure\n&quot;</span>, <span class="stringliteral">&quot;CreateDebugUtilsMessengerEXT Failure&quot;</span>);</div><div class="line"><a name="l03218"></a><span class="lineno"> 3218</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l03219"></a><span class="lineno"> 3219</span>&#160;        }</div><div class="line"><a name="l03220"></a><span class="lineno"> 3220</span>&#160;    }</div><div class="line"><a name="l03221"></a><span class="lineno"> 3221</span>&#160;    vkGetPhysicalDeviceProperties(demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a>, &amp;demo-&gt;<a class="code" href="structdemo.html#a94f4ca5fe491659c6b45bda94b4e729a">gpu_props</a>);</div><div class="line"><a name="l03222"></a><span class="lineno"> 3222</span>&#160;</div><div class="line"><a name="l03223"></a><span class="lineno"> 3223</span>&#160;    <span class="comment">/* Call with NULL data to get count */</span></div><div class="line"><a name="l03224"></a><span class="lineno"> 3224</span>&#160;    vkGetPhysicalDeviceQueueFamilyProperties(demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a>, &amp;demo-&gt;<a class="code" href="structdemo.html#ab5d90de1697320345806250bcc4bd51b">queue_family_count</a>, NULL);</div><div class="line"><a name="l03225"></a><span class="lineno"> 3225</span>&#160;    assert(demo-&gt;<a class="code" href="structdemo.html#ab5d90de1697320345806250bcc4bd51b">queue_family_count</a> &gt;= 1);</div><div class="line"><a name="l03226"></a><span class="lineno"> 3226</span>&#160;</div><div class="line"><a name="l03227"></a><span class="lineno"> 3227</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#ad1d805df20add2d34e6f9a5d9e2f7fd9">queue_props</a> = (VkQueueFamilyProperties *)malloc(demo-&gt;<a class="code" href="structdemo.html#ab5d90de1697320345806250bcc4bd51b">queue_family_count</a> * <span class="keyword">sizeof</span>(VkQueueFamilyProperties));</div><div class="line"><a name="l03228"></a><span class="lineno"> 3228</span>&#160;    vkGetPhysicalDeviceQueueFamilyProperties(demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a>, &amp;demo-&gt;<a class="code" href="structdemo.html#ab5d90de1697320345806250bcc4bd51b">queue_family_count</a>, demo-&gt;<a class="code" href="structdemo.html#ad1d805df20add2d34e6f9a5d9e2f7fd9">queue_props</a>);</div><div class="line"><a name="l03229"></a><span class="lineno"> 3229</span>&#160;</div><div class="line"><a name="l03230"></a><span class="lineno"> 3230</span>&#160;    <span class="comment">// Query fine-grained feature support for this device.</span></div><div class="line"><a name="l03231"></a><span class="lineno"> 3231</span>&#160;    <span class="comment">//  If app has specific feature requirements it should check supported</span></div><div class="line"><a name="l03232"></a><span class="lineno"> 3232</span>&#160;    <span class="comment">//  features based on this query</span></div><div class="line"><a name="l03233"></a><span class="lineno"> 3233</span>&#160;    VkPhysicalDeviceFeatures physDevFeatures;</div><div class="line"><a name="l03234"></a><span class="lineno"> 3234</span>&#160;    vkGetPhysicalDeviceFeatures(demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a>, &amp;physDevFeatures);</div><div class="line"><a name="l03235"></a><span class="lineno"> 3235</span>&#160;</div><div class="line"><a name="l03236"></a><span class="lineno"> 3236</span>&#160;    <a class="code" href="cube_8c.html#afe0326a2a1a9e72834ca67caab932c44">GET_INSTANCE_PROC_ADDR</a>(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, GetPhysicalDeviceSurfaceSupportKHR);</div><div class="line"><a name="l03237"></a><span class="lineno"> 3237</span>&#160;    <a class="code" href="cube_8c.html#afe0326a2a1a9e72834ca67caab932c44">GET_INSTANCE_PROC_ADDR</a>(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, GetPhysicalDeviceSurfaceCapabilitiesKHR);</div><div class="line"><a name="l03238"></a><span class="lineno"> 3238</span>&#160;    <a class="code" href="cube_8c.html#afe0326a2a1a9e72834ca67caab932c44">GET_INSTANCE_PROC_ADDR</a>(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, GetPhysicalDeviceSurfaceFormatsKHR);</div><div class="line"><a name="l03239"></a><span class="lineno"> 3239</span>&#160;    <a class="code" href="cube_8c.html#afe0326a2a1a9e72834ca67caab932c44">GET_INSTANCE_PROC_ADDR</a>(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, GetPhysicalDeviceSurfacePresentModesKHR);</div><div class="line"><a name="l03240"></a><span class="lineno"> 3240</span>&#160;    <a class="code" href="cube_8c.html#afe0326a2a1a9e72834ca67caab932c44">GET_INSTANCE_PROC_ADDR</a>(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, GetSwapchainImagesKHR);</div><div class="line"><a name="l03241"></a><span class="lineno"> 3241</span>&#160;}</div><div class="ttc" id="structdemo_html_a5687f3f32029a20c4b148c7d23f8134d"><div class="ttname"><a href="structdemo.html#a5687f3f32029a20c4b148c7d23f8134d">demo::SetDebugUtilsObjectNameEXT</a></div><div class="ttdeci">PFN_vkSetDebugUtilsObjectNameEXT SetDebugUtilsObjectNameEXT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00446">cube.c:446</a></div></div>
<div class="ttc" id="structdemo_html_a31e84ca0ec847d04922fa8d1b9efacb7"><div class="ttname"><a href="structdemo.html#a31e84ca0ec847d04922fa8d1b9efacb7">demo::VK_GOOGLE_display_timing_enabled</a></div><div class="ttdeci">bool VK_GOOGLE_display_timing_enabled</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00346">cube.c:346</a></div></div>
<div class="ttc" id="structdemo_html_a9cea495b9ff54d3ba78e686d4f5b3a99"><div class="ttname"><a href="structdemo.html#a9cea495b9ff54d3ba78e686d4f5b3a99">demo::CmdInsertDebugUtilsLabelEXT</a></div><div class="ttdeci">PFN_vkCmdInsertDebugUtilsLabelEXT CmdInsertDebugUtilsLabelEXT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00445">cube.c:445</a></div></div>
<div class="ttc" id="structdemo_html_ab35e8474d7bb46e41e1fa0a07593c977"><div class="ttname"><a href="structdemo.html#ab35e8474d7bb46e41e1fa0a07593c977">demo::dbg_messenger</a></div><div class="ttdeci">VkDebugUtilsMessengerEXT dbg_messenger</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00447">cube.c:447</a></div></div>
<div class="ttc" id="structdemo_html_af527d51e6fafb65fec23e3b95b622b93"><div class="ttname"><a href="structdemo.html#af527d51e6fafb65fec23e3b95b622b93">demo::cmd_pool</a></div><div class="ttdeci">VkCommandPool cmd_pool</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00397">cube.c:397</a></div></div>
<div class="ttc" id="structdemo_html_a9c6557c8003a1e6f5646fcf368175de7"><div class="ttname"><a href="structdemo.html#a9c6557c8003a1e6f5646fcf368175de7">demo::enabled_extension_count</a></div><div class="ttdeci">uint32_t enabled_extension_count</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00370">cube.c:370</a></div></div>
<div class="ttc" id="cube_8c_html_a47431f229fafc6047bb34487ee34151a"><div class="ttname"><a href="cube_8c.html#a47431f229fafc6047bb34487ee34151a">debug_messenger_callback</a></div><div class="ttdeci">VKAPI_ATTR VkBool32 VKAPI_CALL debug_messenger_callback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData, void *pUserData)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00453">cube.c:453</a></div></div>
<div class="ttc" id="structdemo_html_ad1d805df20add2d34e6f9a5d9e2f7fd9"><div class="ttname"><a href="structdemo.html#ad1d805df20add2d34e6f9a5d9e2f7fd9">demo::queue_props</a></div><div class="ttdeci">VkQueueFamilyProperties * queue_props</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00367">cube.c:367</a></div></div>
<div class="ttc" id="structdemo_html_a4334cd49fe358dae74dd74cfc2524b7a"><div class="ttname"><a href="structdemo.html#a4334cd49fe358dae74dd74cfc2524b7a">demo::enabled_layer_count</a></div><div class="ttdeci">uint32_t enabled_layer_count</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00371">cube.c:371</a></div></div>
<div class="ttc" id="structdemo_html_ae106507a5332203027ae225fb648ab5f"><div class="ttname"><a href="structdemo.html#ae106507a5332203027ae225fb648ab5f">demo::CmdEndDebugUtilsLabelEXT</a></div><div class="ttdeci">PFN_vkCmdEndDebugUtilsLabelEXT CmdEndDebugUtilsLabelEXT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00444">cube.c:444</a></div></div>
<div class="ttc" id="cube_8c_html_a25f003de16c08a4888b69f619d70f427"><div class="ttname"><a href="cube_8c.html#a25f003de16c08a4888b69f619d70f427">ARRAY_SIZE</a></div><div class="ttdeci">#define ARRAY_SIZE(a)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00073">cube.c:73</a></div></div>
<div class="ttc" id="cube_8c_html_abcfbf263b3a2885f094ece366b4c2a5b"><div class="ttname"><a href="cube_8c.html#abcfbf263b3a2885f094ece366b4c2a5b">demo_check_layers</a></div><div class="ttdeci">static VkBool32 demo_check_layers(uint32_t check_count, char **check_names, uint32_t layer_count, VkLayerProperties *layers)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l02832">cube.c:2832</a></div></div>
<div class="ttc" id="structdemo_html_a07f0cd13803de3f7a2dcdb7274a448c3"><div class="ttname"><a href="structdemo.html#a07f0cd13803de3f7a2dcdb7274a448c3">demo::VK_KHR_incremental_present_enabled</a></div><div class="ttdeci">bool VK_KHR_incremental_present_enabled</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00344">cube.c:344</a></div></div>
<div class="ttc" id="structdemo_html_a9dda601b5bcc75193406a5e6aeda0553"><div class="ttname"><a href="structdemo.html#a9dda601b5bcc75193406a5e6aeda0553">demo::CreateDebugUtilsMessengerEXT</a></div><div class="ttdeci">PFN_vkCreateDebugUtilsMessengerEXT CreateDebugUtilsMessengerEXT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00440">cube.c:440</a></div></div>
<div class="ttc" id="structdemo_html_ac2570a83ce706add3b8a07673237f30c"><div class="ttname"><a href="structdemo.html#ac2570a83ce706add3b8a07673237f30c">demo::is_minimized</a></div><div class="ttdeci">bool is_minimized</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00342">cube.c:342</a></div></div>
<div class="ttc" id="structdemo_html_a8a273601d837eaa47c58ff52cffad7e2"><div class="ttname"><a href="structdemo.html#a8a273601d837eaa47c58ff52cffad7e2">demo::extension_names</a></div><div class="ttdeci">char * extension_names[64]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00372">cube.c:372</a></div></div>
<div class="ttc" id="cube_8c_html_a1714a35ca475fd30144cd4090d94d286"><div class="ttname"><a href="cube_8c.html#a1714a35ca475fd30144cd4090d94d286">DbgMsg</a></div><div class="ttdeci">void DbgMsg(char *fmt,...)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00129">cube.c:129</a></div></div>
<div class="ttc" id="cube_8c_html_a11282d06da34a669ccca5b1a9336c225"><div class="ttname"><a href="cube_8c.html#a11282d06da34a669ccca5b1a9336c225">demo</a></div><div class="ttdeci">struct demo demo</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l02341">cube.c:2341</a></div></div>
<div class="ttc" id="structdemo_html_a94f4ca5fe491659c6b45bda94b4e729a"><div class="ttname"><a href="structdemo.html#a94f4ca5fe491659c6b45bda94b4e729a">demo::gpu_props</a></div><div class="ttdeci">VkPhysicalDeviceProperties gpu_props</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00366">cube.c:366</a></div></div>
<div class="ttc" id="cube_8c_html_ab5541e08a357bb88cd008693b6ffc6db"><div class="ttname"><a href="cube_8c.html#ab5541e08a357bb88cd008693b6ffc6db">APP_SHORT_NAME</a></div><div class="ttdeci">#define APP_SHORT_NAME</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00067">cube.c:67</a></div></div>
<div class="ttc" id="structdemo_html_a9063cdb946b5e9b2112a31724681a8c2"><div class="ttname"><a href="structdemo.html#a9063cdb946b5e9b2112a31724681a8c2">demo::CmdBeginDebugUtilsLabelEXT</a></div><div class="ttdeci">PFN_vkCmdBeginDebugUtilsLabelEXT CmdBeginDebugUtilsLabelEXT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00443">cube.c:443</a></div></div>
<div class="ttc" id="structdemo_html_a1238f2cb459a1255d322dd141f2f4adb"><div class="ttname"><a href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">demo::gpu</a></div><div class="ttdeci">VkPhysicalDevice gpu</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00357">cube.c:357</a></div></div>
<div class="ttc" id="structdemo_html_a8e7e12324626b9eae882d453b8abbe0c"><div class="ttname"><a href="structdemo.html#a8e7e12324626b9eae882d453b8abbe0c">demo::enabled_layers</a></div><div class="ttdeci">char * enabled_layers[64]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00373">cube.c:373</a></div></div>
<div class="ttc" id="structdemo_html_ab5d90de1697320345806250bcc4bd51b"><div class="ttname"><a href="structdemo.html#ab5d90de1697320345806250bcc4bd51b">demo::queue_family_count</a></div><div class="ttdeci">uint32_t queue_family_count</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00450">cube.c:450</a></div></div>
<div class="ttc" id="cube_8c_html_a28fe14fddb8a99da1b8a644308d1a901"><div class="ttname"><a href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a></div><div class="ttdeci">#define ERR_EXIT(err_msg, err_class)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00123">cube.c:123</a></div></div>
<div class="ttc" id="structdemo_html_a3042e9d9a2afa521340ebb55b09e93ef"><div class="ttname"><a href="structdemo.html#a3042e9d9a2afa521340ebb55b09e93ef">demo::validate</a></div><div class="ttdeci">bool validate</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00435">cube.c:435</a></div></div>
<div class="ttc" id="structdemo_html_adcae8daa6e7a30ad72ff6af6207e4add"><div class="ttname"><a href="structdemo.html#adcae8daa6e7a30ad72ff6af6207e4add">demo::DestroyDebugUtilsMessengerEXT</a></div><div class="ttdeci">PFN_vkDestroyDebugUtilsMessengerEXT DestroyDebugUtilsMessengerEXT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00441">cube.c:441</a></div></div>
<div class="ttc" id="structdemo_html_ad5052f1e07e9c04deaa9a1f8e4e13654"><div class="ttname"><a href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">demo::inst</a></div><div class="ttdeci">VkInstance inst</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00356">cube.c:356</a></div></div>
<div class="ttc" id="structdemo_html_aee1622f529b876ea0dcdcaadc798beda"><div class="ttname"><a href="structdemo.html#aee1622f529b876ea0dcdcaadc798beda">demo::SubmitDebugUtilsMessageEXT</a></div><div class="ttdeci">PFN_vkSubmitDebugUtilsMessageEXT SubmitDebugUtilsMessageEXT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00442">cube.c:442</a></div></div>
<div class="ttc" id="cube_8c_html_afe0326a2a1a9e72834ca67caab932c44"><div class="ttname"><a href="cube_8c.html#afe0326a2a1a9e72834ca67caab932c44">GET_INSTANCE_PROC_ADDR</a></div><div class="ttdeci">#define GET_INSTANCE_PROC_ADDR(inst, entrypoint)                                                                                                                        </div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00138">cube.c:138</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_abdcd6d1f2fdbb957fd5c0337d86a286c_cgraph.png" border="0" usemap="#cube_8c_abdcd6d1f2fdbb957fd5c0337d86a286c_cgraph" alt=""/></div>
<map name="cube_8c_abdcd6d1f2fdbb957fd5c0337d86a286c_cgraph" id="cube_8c_abdcd6d1f2fdbb957fd5c0337d86a286c_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#a1714a35ca475fd30144cd4090d94d286" title="DbgMsg" alt="" coords="207,5,277,32"/>
<area shape="rect" id="node3" href="cube_8c.html#a47431f229fafc6047bb34487ee34151a" title="debug_messenger_callback" alt="" coords="151,56,333,83"/>
<area shape="rect" id="node4" href="cube_8c.html#abcfbf263b3a2885f094ece366b4c2a5b" title="demo_check_layers" alt="" coords="173,107,311,133"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_abdcd6d1f2fdbb957fd5c0337d86a286c_icgraph.png" border="0" usemap="#cube_8c_abdcd6d1f2fdbb957fd5c0337d86a286c_icgraph" alt=""/></div>
<map name="cube_8c_abdcd6d1f2fdbb957fd5c0337d86a286c_icgraph" id="cube_8c_abdcd6d1f2fdbb957fd5c0337d86a286c_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a9614fd51f6e418355a34964db328d781" title="demo_init" alt="" coords="151,5,229,32"/>
<area shape="rect" id="node3" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="277,5,351,32"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ab8af4815cac383b0436928fe474b98b3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_init_vk_swapchain </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l03278">3278</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00377">demo::color_space</a>, <a class="el" href="cube_8c_source.html#l00308">demo::connection</a>, <a class="el" href="cube_8c_source.html#l00433">demo::curFrame</a>, <a class="el" href="cube_8c_source.html#l03243">demo_create_device()</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00364">demo::draw_complete_semaphores</a>, <a class="el" href="cube_8c_source.html#l00123">ERR_EXIT</a>, <a class="el" href="cube_8c_source.html#l00394">demo::fences</a>, <a class="el" href="cube_8c_source.html#l00376">demo::format</a>, <a class="el" href="cube_8c_source.html#l00381">demo::fpGetPhysicalDeviceSurfaceFormatsKHR</a>, <a class="el" href="cube_8c_source.html#l00379">demo::fpGetPhysicalDeviceSurfaceSupportKHR</a>, <a class="el" href="cube_8c_source.html#l00395">demo::frame_index</a>, <a class="el" href="cube_8c_source.html#l00071">FRAME_LAG</a>, <a class="el" href="cube_8c_source.html#l00148">GET_DEVICE_PROC_ADDR</a>, <a class="el" href="cube_8c_source.html#l00357">demo::gpu</a>, <a class="el" href="cube_8c_source.html#l00359">demo::graphics_queue</a>, <a class="el" href="cube_8c_source.html#l00361">demo::graphics_queue_family_index</a>, <a class="el" href="cube_8c_source.html#l00363">demo::image_acquired_semaphores</a>, <a class="el" href="cube_8c_source.html#l00365">demo::image_ownership_semaphores</a>, <a class="el" href="cube_8c_source.html#l00356">demo::inst</a>, <a class="el" href="cube_8c_source.html#l00368">demo::memory_properties</a>, <a class="el" href="cube_8c_source.html#l00309">demo::name</a>, <a class="el" href="cube_8c_source.html#l00425">demo::pause</a>, <a class="el" href="cube_8c_source.html#l00360">demo::present_queue</a>, <a class="el" href="cube_8c_source.html#l00362">demo::present_queue_family_index</a>, <a class="el" href="cube_8c_source.html#l00450">demo::queue_family_count</a>, <a class="el" href="cube_8c_source.html#l00367">demo::queue_props</a>, <a class="el" href="cube_8c_source.html#l00432">demo::quit</a>, <a class="el" href="cube_8c_source.html#l00341">demo::separate_present_queue</a>, <a class="el" href="cube_8c_source.html#l00423">demo::spin_angle</a>, <a class="el" href="cube_8c_source.html#l00424">demo::spin_increment</a>, <a class="el" href="cube_8c_source.html#l00338">demo::surface</a>, <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>, <a class="el" href="cube_8c_source.html#l00084">UNUSED</a>, <a class="el" href="cube_8c_source.html#l00346">demo::VK_GOOGLE_display_timing_enabled</a>, and <a class="el" href="cube_8c_source.html#l00310">demo::window</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l03702">WinMain()</a>.</p>
<div class="fragment"><div class="line"><a name="l03278"></a><span class="lineno"> 3278</span>&#160;                                                      {</div><div class="line"><a name="l03279"></a><span class="lineno"> 3279</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l03280"></a><span class="lineno"> 3280</span>&#160;</div><div class="line"><a name="l03281"></a><span class="lineno"> 3281</span>&#160;<span class="comment">// Create a WSI surface for the window:</span></div><div class="line"><a name="l03282"></a><span class="lineno"> 3282</span>&#160;<span class="preprocessor">#if defined(VK_USE_PLATFORM_WIN32_KHR)</span></div><div class="line"><a name="l03283"></a><span class="lineno"> 3283</span>&#160;    VkWin32SurfaceCreateInfoKHR createInfo;</div><div class="line"><a name="l03284"></a><span class="lineno"> 3284</span>&#160;    createInfo.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR;</div><div class="line"><a name="l03285"></a><span class="lineno"> 3285</span>&#160;    createInfo.pNext = NULL;</div><div class="line"><a name="l03286"></a><span class="lineno"> 3286</span>&#160;    createInfo.flags = 0;</div><div class="line"><a name="l03287"></a><span class="lineno"> 3287</span>&#160;    createInfo.hinstance = demo-&gt;<a class="code" href="structdemo.html#a4f271161fb166d561f5da630dd0de222">connection</a>;</div><div class="line"><a name="l03288"></a><span class="lineno"> 3288</span>&#160;    createInfo.hwnd = demo-&gt;<a class="code" href="structdemo.html#a096ec114abccb153f4043e8b1c75be22">window</a>;</div><div class="line"><a name="l03289"></a><span class="lineno"> 3289</span>&#160;</div><div class="line"><a name="l03290"></a><span class="lineno"> 3290</span>&#160;    err = vkCreateWin32SurfaceKHR(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, &amp;createInfo, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a>);</div><div class="line"><a name="l03291"></a><span class="lineno"> 3291</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)</span></div><div class="line"><a name="l03292"></a><span class="lineno"> 3292</span>&#160;    VkWaylandSurfaceCreateInfoKHR createInfo;</div><div class="line"><a name="l03293"></a><span class="lineno"> 3293</span>&#160;    createInfo.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR;</div><div class="line"><a name="l03294"></a><span class="lineno"> 3294</span>&#160;    createInfo.pNext = NULL;</div><div class="line"><a name="l03295"></a><span class="lineno"> 3295</span>&#160;    createInfo.flags = 0;</div><div class="line"><a name="l03296"></a><span class="lineno"> 3296</span>&#160;    createInfo.display = demo-&gt;display;</div><div class="line"><a name="l03297"></a><span class="lineno"> 3297</span>&#160;    createInfo.<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a> = demo-&gt;<a class="code" href="structdemo.html#a096ec114abccb153f4043e8b1c75be22">window</a>;</div><div class="line"><a name="l03298"></a><span class="lineno"> 3298</span>&#160;</div><div class="line"><a name="l03299"></a><span class="lineno"> 3299</span>&#160;    err = vkCreateWaylandSurfaceKHR(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, &amp;createInfo, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a>);</div><div class="line"><a name="l03300"></a><span class="lineno"> 3300</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_MIR_KHR)</span></div><div class="line"><a name="l03301"></a><span class="lineno"> 3301</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_ANDROID_KHR)</span></div><div class="line"><a name="l03302"></a><span class="lineno"> 3302</span>&#160;    VkAndroidSurfaceCreateInfoKHR createInfo;</div><div class="line"><a name="l03303"></a><span class="lineno"> 3303</span>&#160;    createInfo.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR;</div><div class="line"><a name="l03304"></a><span class="lineno"> 3304</span>&#160;    createInfo.pNext = NULL;</div><div class="line"><a name="l03305"></a><span class="lineno"> 3305</span>&#160;    createInfo.flags = 0;</div><div class="line"><a name="l03306"></a><span class="lineno"> 3306</span>&#160;    createInfo.window = (<span class="keyword">struct </span>ANativeWindow *)(demo-&gt;<a class="code" href="structdemo.html#a096ec114abccb153f4043e8b1c75be22">window</a>);</div><div class="line"><a name="l03307"></a><span class="lineno"> 3307</span>&#160;</div><div class="line"><a name="l03308"></a><span class="lineno"> 3308</span>&#160;    err = vkCreateAndroidSurfaceKHR(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, &amp;createInfo, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a>);</div><div class="line"><a name="l03309"></a><span class="lineno"> 3309</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_XLIB_KHR)</span></div><div class="line"><a name="l03310"></a><span class="lineno"> 3310</span>&#160;    VkXlibSurfaceCreateInfoKHR createInfo;</div><div class="line"><a name="l03311"></a><span class="lineno"> 3311</span>&#160;    createInfo.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR;</div><div class="line"><a name="l03312"></a><span class="lineno"> 3312</span>&#160;    createInfo.pNext = NULL;</div><div class="line"><a name="l03313"></a><span class="lineno"> 3313</span>&#160;    createInfo.flags = 0;</div><div class="line"><a name="l03314"></a><span class="lineno"> 3314</span>&#160;    createInfo.dpy = demo-&gt;display;</div><div class="line"><a name="l03315"></a><span class="lineno"> 3315</span>&#160;    createInfo.<a class="code" href="structdemo.html#a096ec114abccb153f4043e8b1c75be22">window</a> = demo-&gt;xlib_window;</div><div class="line"><a name="l03316"></a><span class="lineno"> 3316</span>&#160;</div><div class="line"><a name="l03317"></a><span class="lineno"> 3317</span>&#160;    err = vkCreateXlibSurfaceKHR(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, &amp;createInfo, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a>);</div><div class="line"><a name="l03318"></a><span class="lineno"> 3318</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_XCB_KHR)</span></div><div class="line"><a name="l03319"></a><span class="lineno"> 3319</span>&#160;    VkXcbSurfaceCreateInfoKHR createInfo;</div><div class="line"><a name="l03320"></a><span class="lineno"> 3320</span>&#160;    createInfo.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR;</div><div class="line"><a name="l03321"></a><span class="lineno"> 3321</span>&#160;    createInfo.pNext = NULL;</div><div class="line"><a name="l03322"></a><span class="lineno"> 3322</span>&#160;    createInfo.flags = 0;</div><div class="line"><a name="l03323"></a><span class="lineno"> 3323</span>&#160;    createInfo.connection = demo-&gt;<a class="code" href="structdemo.html#a4f271161fb166d561f5da630dd0de222">connection</a>;</div><div class="line"><a name="l03324"></a><span class="lineno"> 3324</span>&#160;    createInfo.window = demo-&gt;xcb_window;</div><div class="line"><a name="l03325"></a><span class="lineno"> 3325</span>&#160;</div><div class="line"><a name="l03326"></a><span class="lineno"> 3326</span>&#160;    err = vkCreateXcbSurfaceKHR(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, &amp;createInfo, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a>);</div><div class="line"><a name="l03327"></a><span class="lineno"> 3327</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_DISPLAY_KHR)</span></div><div class="line"><a name="l03328"></a><span class="lineno"> 3328</span>&#160;    err = demo_create_display_surface(demo);</div><div class="line"><a name="l03329"></a><span class="lineno"> 3329</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_IOS_MVK)</span></div><div class="line"><a name="l03330"></a><span class="lineno"> 3330</span>&#160;    VkIOSSurfaceCreateInfoMVK surface;</div><div class="line"><a name="l03331"></a><span class="lineno"> 3331</span>&#160;    surface.sType = VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK;</div><div class="line"><a name="l03332"></a><span class="lineno"> 3332</span>&#160;    surface.pNext = NULL;</div><div class="line"><a name="l03333"></a><span class="lineno"> 3333</span>&#160;    surface.flags = 0;</div><div class="line"><a name="l03334"></a><span class="lineno"> 3334</span>&#160;    surface.pView = demo-&gt;<a class="code" href="structdemo.html#a096ec114abccb153f4043e8b1c75be22">window</a>;</div><div class="line"><a name="l03335"></a><span class="lineno"> 3335</span>&#160;</div><div class="line"><a name="l03336"></a><span class="lineno"> 3336</span>&#160;    err = vkCreateIOSSurfaceMVK(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, &amp;surface, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a>);</div><div class="line"><a name="l03337"></a><span class="lineno"> 3337</span>&#160;<span class="preprocessor">#elif defined(VK_USE_PLATFORM_MACOS_MVK)</span></div><div class="line"><a name="l03338"></a><span class="lineno"> 3338</span>&#160;    VkMacOSSurfaceCreateInfoMVK surface;</div><div class="line"><a name="l03339"></a><span class="lineno"> 3339</span>&#160;    surface.sType = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK;</div><div class="line"><a name="l03340"></a><span class="lineno"> 3340</span>&#160;    surface.pNext = NULL;</div><div class="line"><a name="l03341"></a><span class="lineno"> 3341</span>&#160;    surface.flags = 0;</div><div class="line"><a name="l03342"></a><span class="lineno"> 3342</span>&#160;    surface.pView = demo-&gt;<a class="code" href="structdemo.html#a096ec114abccb153f4043e8b1c75be22">window</a>;</div><div class="line"><a name="l03343"></a><span class="lineno"> 3343</span>&#160;</div><div class="line"><a name="l03344"></a><span class="lineno"> 3344</span>&#160;    err = vkCreateMacOSSurfaceMVK(demo-&gt;<a class="code" href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">inst</a>, &amp;surface, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a>);</div><div class="line"><a name="l03345"></a><span class="lineno"> 3345</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l03346"></a><span class="lineno"> 3346</span>&#160;    assert(!err);</div><div class="line"><a name="l03347"></a><span class="lineno"> 3347</span>&#160;</div><div class="line"><a name="l03348"></a><span class="lineno"> 3348</span>&#160;    <span class="comment">// Iterate over each queue to learn whether it supports presenting:</span></div><div class="line"><a name="l03349"></a><span class="lineno"> 3349</span>&#160;    VkBool32 *supportsPresent = (VkBool32 *)malloc(demo-&gt;<a class="code" href="structdemo.html#ab5d90de1697320345806250bcc4bd51b">queue_family_count</a> * <span class="keyword">sizeof</span>(VkBool32));</div><div class="line"><a name="l03350"></a><span class="lineno"> 3350</span>&#160;    <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; demo-&gt;<a class="code" href="structdemo.html#ab5d90de1697320345806250bcc4bd51b">queue_family_count</a>; i++) {</div><div class="line"><a name="l03351"></a><span class="lineno"> 3351</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#af46680459ee64109f859980ee9165a94">fpGetPhysicalDeviceSurfaceSupportKHR</a>(demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a>, i, demo-&gt;<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a>, &amp;supportsPresent[i]);</div><div class="line"><a name="l03352"></a><span class="lineno"> 3352</span>&#160;    }</div><div class="line"><a name="l03353"></a><span class="lineno"> 3353</span>&#160;</div><div class="line"><a name="l03354"></a><span class="lineno"> 3354</span>&#160;    <span class="comment">// Search for a graphics and a present queue in the array of queue</span></div><div class="line"><a name="l03355"></a><span class="lineno"> 3355</span>&#160;    <span class="comment">// families, try to find one that supports both</span></div><div class="line"><a name="l03356"></a><span class="lineno"> 3356</span>&#160;    uint32_t graphicsQueueFamilyIndex = UINT32_MAX;</div><div class="line"><a name="l03357"></a><span class="lineno"> 3357</span>&#160;    uint32_t presentQueueFamilyIndex = UINT32_MAX;</div><div class="line"><a name="l03358"></a><span class="lineno"> 3358</span>&#160;    <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; demo-&gt;<a class="code" href="structdemo.html#ab5d90de1697320345806250bcc4bd51b">queue_family_count</a>; i++) {</div><div class="line"><a name="l03359"></a><span class="lineno"> 3359</span>&#160;        <span class="keywordflow">if</span> ((demo-&gt;<a class="code" href="structdemo.html#ad1d805df20add2d34e6f9a5d9e2f7fd9">queue_props</a>[i].queueFlags &amp; VK_QUEUE_GRAPHICS_BIT) != 0) {</div><div class="line"><a name="l03360"></a><span class="lineno"> 3360</span>&#160;            <span class="keywordflow">if</span> (graphicsQueueFamilyIndex == UINT32_MAX) {</div><div class="line"><a name="l03361"></a><span class="lineno"> 3361</span>&#160;                graphicsQueueFamilyIndex = i;</div><div class="line"><a name="l03362"></a><span class="lineno"> 3362</span>&#160;            }</div><div class="line"><a name="l03363"></a><span class="lineno"> 3363</span>&#160;</div><div class="line"><a name="l03364"></a><span class="lineno"> 3364</span>&#160;            <span class="keywordflow">if</span> (supportsPresent[i] == VK_TRUE) {</div><div class="line"><a name="l03365"></a><span class="lineno"> 3365</span>&#160;                graphicsQueueFamilyIndex = i;</div><div class="line"><a name="l03366"></a><span class="lineno"> 3366</span>&#160;                presentQueueFamilyIndex = i;</div><div class="line"><a name="l03367"></a><span class="lineno"> 3367</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l03368"></a><span class="lineno"> 3368</span>&#160;            }</div><div class="line"><a name="l03369"></a><span class="lineno"> 3369</span>&#160;        }</div><div class="line"><a name="l03370"></a><span class="lineno"> 3370</span>&#160;    }</div><div class="line"><a name="l03371"></a><span class="lineno"> 3371</span>&#160;</div><div class="line"><a name="l03372"></a><span class="lineno"> 3372</span>&#160;    <span class="keywordflow">if</span> (presentQueueFamilyIndex == UINT32_MAX) {</div><div class="line"><a name="l03373"></a><span class="lineno"> 3373</span>&#160;        <span class="comment">// If didn&#39;t find a queue that supports both graphics and present, then</span></div><div class="line"><a name="l03374"></a><span class="lineno"> 3374</span>&#160;        <span class="comment">// find a separate present queue.</span></div><div class="line"><a name="l03375"></a><span class="lineno"> 3375</span>&#160;        <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; demo-&gt;<a class="code" href="structdemo.html#ab5d90de1697320345806250bcc4bd51b">queue_family_count</a>; ++i) {</div><div class="line"><a name="l03376"></a><span class="lineno"> 3376</span>&#160;            <span class="keywordflow">if</span> (supportsPresent[i] == VK_TRUE) {</div><div class="line"><a name="l03377"></a><span class="lineno"> 3377</span>&#160;                presentQueueFamilyIndex = i;</div><div class="line"><a name="l03378"></a><span class="lineno"> 3378</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l03379"></a><span class="lineno"> 3379</span>&#160;            }</div><div class="line"><a name="l03380"></a><span class="lineno"> 3380</span>&#160;        }</div><div class="line"><a name="l03381"></a><span class="lineno"> 3381</span>&#160;    }</div><div class="line"><a name="l03382"></a><span class="lineno"> 3382</span>&#160;</div><div class="line"><a name="l03383"></a><span class="lineno"> 3383</span>&#160;    <span class="comment">// Generate error if could not find both a graphics and a present queue</span></div><div class="line"><a name="l03384"></a><span class="lineno"> 3384</span>&#160;    <span class="keywordflow">if</span> (graphicsQueueFamilyIndex == UINT32_MAX || presentQueueFamilyIndex == UINT32_MAX) {</div><div class="line"><a name="l03385"></a><span class="lineno"> 3385</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;Could not find both graphics and present queues\n&quot;</span>, <span class="stringliteral">&quot;Swapchain Initialization Failure&quot;</span>);</div><div class="line"><a name="l03386"></a><span class="lineno"> 3386</span>&#160;    }</div><div class="line"><a name="l03387"></a><span class="lineno"> 3387</span>&#160;</div><div class="line"><a name="l03388"></a><span class="lineno"> 3388</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a9f7e94f1331e93955bcfdfb6596fedc1">graphics_queue_family_index</a> = graphicsQueueFamilyIndex;</div><div class="line"><a name="l03389"></a><span class="lineno"> 3389</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a8e9f41863731d6ab805b8d632f3d0c9d">present_queue_family_index</a> = presentQueueFamilyIndex;</div><div class="line"><a name="l03390"></a><span class="lineno"> 3390</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">separate_present_queue</a> = (demo-&gt;<a class="code" href="structdemo.html#a9f7e94f1331e93955bcfdfb6596fedc1">graphics_queue_family_index</a> != demo-&gt;<a class="code" href="structdemo.html#a8e9f41863731d6ab805b8d632f3d0c9d">present_queue_family_index</a>);</div><div class="line"><a name="l03391"></a><span class="lineno"> 3391</span>&#160;    free(supportsPresent);</div><div class="line"><a name="l03392"></a><span class="lineno"> 3392</span>&#160;</div><div class="line"><a name="l03393"></a><span class="lineno"> 3393</span>&#160;    <a class="code" href="cube_8c.html#ac570d41514a55546127adf73c8faef66">demo_create_device</a>(demo);</div><div class="line"><a name="l03394"></a><span class="lineno"> 3394</span>&#160;</div><div class="line"><a name="l03395"></a><span class="lineno"> 3395</span>&#160;    <a class="code" href="cube_8c.html#ab5c664496b8f5564aac41b936cb8bbf8">GET_DEVICE_PROC_ADDR</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, CreateSwapchainKHR);</div><div class="line"><a name="l03396"></a><span class="lineno"> 3396</span>&#160;    <a class="code" href="cube_8c.html#ab5c664496b8f5564aac41b936cb8bbf8">GET_DEVICE_PROC_ADDR</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, DestroySwapchainKHR);</div><div class="line"><a name="l03397"></a><span class="lineno"> 3397</span>&#160;    <a class="code" href="cube_8c.html#ab5c664496b8f5564aac41b936cb8bbf8">GET_DEVICE_PROC_ADDR</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, GetSwapchainImagesKHR);</div><div class="line"><a name="l03398"></a><span class="lineno"> 3398</span>&#160;    <a class="code" href="cube_8c.html#ab5c664496b8f5564aac41b936cb8bbf8">GET_DEVICE_PROC_ADDR</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, AcquireNextImageKHR);</div><div class="line"><a name="l03399"></a><span class="lineno"> 3399</span>&#160;    <a class="code" href="cube_8c.html#ab5c664496b8f5564aac41b936cb8bbf8">GET_DEVICE_PROC_ADDR</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, QueuePresentKHR);</div><div class="line"><a name="l03400"></a><span class="lineno"> 3400</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a31e84ca0ec847d04922fa8d1b9efacb7">VK_GOOGLE_display_timing_enabled</a>) {</div><div class="line"><a name="l03401"></a><span class="lineno"> 3401</span>&#160;        <a class="code" href="cube_8c.html#ab5c664496b8f5564aac41b936cb8bbf8">GET_DEVICE_PROC_ADDR</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, GetRefreshCycleDurationGOOGLE);</div><div class="line"><a name="l03402"></a><span class="lineno"> 3402</span>&#160;        <a class="code" href="cube_8c.html#ab5c664496b8f5564aac41b936cb8bbf8">GET_DEVICE_PROC_ADDR</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, GetPastPresentationTimingGOOGLE);</div><div class="line"><a name="l03403"></a><span class="lineno"> 3403</span>&#160;    }</div><div class="line"><a name="l03404"></a><span class="lineno"> 3404</span>&#160;</div><div class="line"><a name="l03405"></a><span class="lineno"> 3405</span>&#160;    vkGetDeviceQueue(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a9f7e94f1331e93955bcfdfb6596fedc1">graphics_queue_family_index</a>, 0, &amp;demo-&gt;<a class="code" href="structdemo.html#abf27a3cd9fc6390bfb89202443aca026">graphics_queue</a>);</div><div class="line"><a name="l03406"></a><span class="lineno"> 3406</span>&#160;</div><div class="line"><a name="l03407"></a><span class="lineno"> 3407</span>&#160;    <span class="keywordflow">if</span> (!demo-&gt;<a class="code" href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">separate_present_queue</a>) {</div><div class="line"><a name="l03408"></a><span class="lineno"> 3408</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#afd529ef5cf4122199b49e313c57c054a">present_queue</a> = demo-&gt;<a class="code" href="structdemo.html#abf27a3cd9fc6390bfb89202443aca026">graphics_queue</a>;</div><div class="line"><a name="l03409"></a><span class="lineno"> 3409</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l03410"></a><span class="lineno"> 3410</span>&#160;        vkGetDeviceQueue(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a8e9f41863731d6ab805b8d632f3d0c9d">present_queue_family_index</a>, 0, &amp;demo-&gt;<a class="code" href="structdemo.html#afd529ef5cf4122199b49e313c57c054a">present_queue</a>);</div><div class="line"><a name="l03411"></a><span class="lineno"> 3411</span>&#160;    }</div><div class="line"><a name="l03412"></a><span class="lineno"> 3412</span>&#160;</div><div class="line"><a name="l03413"></a><span class="lineno"> 3413</span>&#160;    <span class="comment">// Get the list of VkFormat&#39;s that are supported:</span></div><div class="line"><a name="l03414"></a><span class="lineno"> 3414</span>&#160;    uint32_t formatCount;</div><div class="line"><a name="l03415"></a><span class="lineno"> 3415</span>&#160;    err = demo-&gt;<a class="code" href="structdemo.html#a857402ee014d13bb9fa5a9dfa46da5ff">fpGetPhysicalDeviceSurfaceFormatsKHR</a>(demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a>, demo-&gt;<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a>, &amp;formatCount, NULL);</div><div class="line"><a name="l03416"></a><span class="lineno"> 3416</span>&#160;    assert(!err);</div><div class="line"><a name="l03417"></a><span class="lineno"> 3417</span>&#160;    VkSurfaceFormatKHR *surfFormats = (VkSurfaceFormatKHR *)malloc(formatCount * <span class="keyword">sizeof</span>(VkSurfaceFormatKHR));</div><div class="line"><a name="l03418"></a><span class="lineno"> 3418</span>&#160;    err = demo-&gt;<a class="code" href="structdemo.html#a857402ee014d13bb9fa5a9dfa46da5ff">fpGetPhysicalDeviceSurfaceFormatsKHR</a>(demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a>, demo-&gt;<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a>, &amp;formatCount, surfFormats);</div><div class="line"><a name="l03419"></a><span class="lineno"> 3419</span>&#160;    assert(!err);</div><div class="line"><a name="l03420"></a><span class="lineno"> 3420</span>&#160;    <span class="comment">// If the format list includes just one entry of VK_FORMAT_UNDEFINED,</span></div><div class="line"><a name="l03421"></a><span class="lineno"> 3421</span>&#160;    <span class="comment">// the surface has no preferred format.  Otherwise, at least one</span></div><div class="line"><a name="l03422"></a><span class="lineno"> 3422</span>&#160;    <span class="comment">// supported format will be returned.</span></div><div class="line"><a name="l03423"></a><span class="lineno"> 3423</span>&#160;    <span class="keywordflow">if</span> (formatCount == 1 &amp;&amp; surfFormats[0].format == VK_FORMAT_UNDEFINED) {</div><div class="line"><a name="l03424"></a><span class="lineno"> 3424</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a8d379997ae0b03bfedacc9ca8145dd71">format</a> = VK_FORMAT_B8G8R8A8_UNORM;</div><div class="line"><a name="l03425"></a><span class="lineno"> 3425</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l03426"></a><span class="lineno"> 3426</span>&#160;        assert(formatCount &gt;= 1);</div><div class="line"><a name="l03427"></a><span class="lineno"> 3427</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a8d379997ae0b03bfedacc9ca8145dd71">format</a> = surfFormats[0].format;</div><div class="line"><a name="l03428"></a><span class="lineno"> 3428</span>&#160;    }</div><div class="line"><a name="l03429"></a><span class="lineno"> 3429</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a36dbf6fc5ca79840c712e27c47123f2c">color_space</a> = surfFormats[0].colorSpace;</div><div class="line"><a name="l03430"></a><span class="lineno"> 3430</span>&#160;</div><div class="line"><a name="l03431"></a><span class="lineno"> 3431</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#ae56fd93d74bee16770a0043684ebbcb2">quit</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l03432"></a><span class="lineno"> 3432</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a801600c468658c9dc656ef904f429f15">curFrame</a> = 0;</div><div class="line"><a name="l03433"></a><span class="lineno"> 3433</span>&#160;</div><div class="line"><a name="l03434"></a><span class="lineno"> 3434</span>&#160;    <span class="comment">// Create semaphores to synchronize acquiring presentable buffers before</span></div><div class="line"><a name="l03435"></a><span class="lineno"> 3435</span>&#160;    <span class="comment">// rendering and waiting for drawing to be complete before presenting</span></div><div class="line"><a name="l03436"></a><span class="lineno"> 3436</span>&#160;    VkSemaphoreCreateInfo semaphoreCreateInfo = {</div><div class="line"><a name="l03437"></a><span class="lineno"> 3437</span>&#160;        .sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO,</div><div class="line"><a name="l03438"></a><span class="lineno"> 3438</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l03439"></a><span class="lineno"> 3439</span>&#160;        .flags = 0,</div><div class="line"><a name="l03440"></a><span class="lineno"> 3440</span>&#160;    };</div><div class="line"><a name="l03441"></a><span class="lineno"> 3441</span>&#160;</div><div class="line"><a name="l03442"></a><span class="lineno"> 3442</span>&#160;    <span class="comment">// Create fences that we can use to throttle if we get too far</span></div><div class="line"><a name="l03443"></a><span class="lineno"> 3443</span>&#160;    <span class="comment">// ahead of the image presents</span></div><div class="line"><a name="l03444"></a><span class="lineno"> 3444</span>&#160;    VkFenceCreateInfo fence_ci = {</div><div class="line"><a name="l03445"></a><span class="lineno"> 3445</span>&#160;        .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, .pNext = NULL, .flags = VK_FENCE_CREATE_SIGNALED_BIT};</div><div class="line"><a name="l03446"></a><span class="lineno"> 3446</span>&#160;    <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; <a class="code" href="cube_8c.html#a44a58ed35161ff13de8fbf41f913a729">FRAME_LAG</a>; i++) {</div><div class="line"><a name="l03447"></a><span class="lineno"> 3447</span>&#160;        err = vkCreateFence(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;fence_ci, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#aee60ae051d1ee577f267ecc3b8da36ef">fences</a>[i]);</div><div class="line"><a name="l03448"></a><span class="lineno"> 3448</span>&#160;        assert(!err);</div><div class="line"><a name="l03449"></a><span class="lineno"> 3449</span>&#160;</div><div class="line"><a name="l03450"></a><span class="lineno"> 3450</span>&#160;        err = vkCreateSemaphore(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;semaphoreCreateInfo, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#ae0d984aad2f9eb0779c6ec09df17d183">image_acquired_semaphores</a>[i]);</div><div class="line"><a name="l03451"></a><span class="lineno"> 3451</span>&#160;        assert(!err);</div><div class="line"><a name="l03452"></a><span class="lineno"> 3452</span>&#160;</div><div class="line"><a name="l03453"></a><span class="lineno"> 3453</span>&#160;        err = vkCreateSemaphore(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;semaphoreCreateInfo, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#ab86850eb961f077b1c65bbfa50f4111e">draw_complete_semaphores</a>[i]);</div><div class="line"><a name="l03454"></a><span class="lineno"> 3454</span>&#160;        assert(!err);</div><div class="line"><a name="l03455"></a><span class="lineno"> 3455</span>&#160;</div><div class="line"><a name="l03456"></a><span class="lineno"> 3456</span>&#160;        <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">separate_present_queue</a>) {</div><div class="line"><a name="l03457"></a><span class="lineno"> 3457</span>&#160;            err = vkCreateSemaphore(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;semaphoreCreateInfo, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a2bba0ce9e5e1866670c37cec1ed784c5">image_ownership_semaphores</a>[i]);</div><div class="line"><a name="l03458"></a><span class="lineno"> 3458</span>&#160;            assert(!err);</div><div class="line"><a name="l03459"></a><span class="lineno"> 3459</span>&#160;        }</div><div class="line"><a name="l03460"></a><span class="lineno"> 3460</span>&#160;    }</div><div class="line"><a name="l03461"></a><span class="lineno"> 3461</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#abbac641d0c27f49b126a4e08edd3e54f">frame_index</a> = 0;</div><div class="line"><a name="l03462"></a><span class="lineno"> 3462</span>&#160;</div><div class="line"><a name="l03463"></a><span class="lineno"> 3463</span>&#160;    <span class="comment">// Get Memory information and properties</span></div><div class="line"><a name="l03464"></a><span class="lineno"> 3464</span>&#160;    vkGetPhysicalDeviceMemoryProperties(demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a>, &amp;demo-&gt;<a class="code" href="structdemo.html#a304121602ddaf81bb53f28c856ea335f">memory_properties</a>);</div><div class="line"><a name="l03465"></a><span class="lineno"> 3465</span>&#160;}</div><div class="ttc" id="structdemo_html_a8e9f41863731d6ab805b8d632f3d0c9d"><div class="ttname"><a href="structdemo.html#a8e9f41863731d6ab805b8d632f3d0c9d">demo::present_queue_family_index</a></div><div class="ttdeci">uint32_t present_queue_family_index</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00362">cube.c:362</a></div></div>
<div class="ttc" id="structdemo_html_a31e84ca0ec847d04922fa8d1b9efacb7"><div class="ttname"><a href="structdemo.html#a31e84ca0ec847d04922fa8d1b9efacb7">demo::VK_GOOGLE_display_timing_enabled</a></div><div class="ttdeci">bool VK_GOOGLE_display_timing_enabled</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00346">cube.c:346</a></div></div>
<div class="ttc" id="cube_8c_html_ab5c664496b8f5564aac41b936cb8bbf8"><div class="ttname"><a href="cube_8c.html#ab5c664496b8f5564aac41b936cb8bbf8">GET_DEVICE_PROC_ADDR</a></div><div class="ttdeci">#define GET_DEVICE_PROC_ADDR(dev, entrypoint)                                                                                                                                    </div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00148">cube.c:148</a></div></div>
<div class="ttc" id="structdemo_html_abbac641d0c27f49b126a4e08edd3e54f"><div class="ttname"><a href="structdemo.html#abbac641d0c27f49b126a4e08edd3e54f">demo::frame_index</a></div><div class="ttdeci">int frame_index</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00395">cube.c:395</a></div></div>
<div class="ttc" id="structdemo_html_aee60ae051d1ee577f267ecc3b8da36ef"><div class="ttname"><a href="structdemo.html#aee60ae051d1ee577f267ecc3b8da36ef">demo::fences</a></div><div class="ttdeci">VkFence fences[FRAME_LAG]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00394">cube.c:394</a></div></div>
<div class="ttc" id="cube_8c_html_a44a58ed35161ff13de8fbf41f913a729"><div class="ttname"><a href="cube_8c.html#a44a58ed35161ff13de8fbf41f913a729">FRAME_LAG</a></div><div class="ttdeci">#define FRAME_LAG</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00071">cube.c:71</a></div></div>
<div class="ttc" id="structdemo_html_a2bba0ce9e5e1866670c37cec1ed784c5"><div class="ttname"><a href="structdemo.html#a2bba0ce9e5e1866670c37cec1ed784c5">demo::image_ownership_semaphores</a></div><div class="ttdeci">VkSemaphore image_ownership_semaphores[FRAME_LAG]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00365">cube.c:365</a></div></div>
<div class="ttc" id="structdemo_html_ae56fd93d74bee16770a0043684ebbcb2"><div class="ttname"><a href="structdemo.html#ae56fd93d74bee16770a0043684ebbcb2">demo::quit</a></div><div class="ttdeci">bool quit</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00432">cube.c:432</a></div></div>
<div class="ttc" id="structdemo_html_ae0d984aad2f9eb0779c6ec09df17d183"><div class="ttname"><a href="structdemo.html#ae0d984aad2f9eb0779c6ec09df17d183">demo::image_acquired_semaphores</a></div><div class="ttdeci">VkSemaphore image_acquired_semaphores[FRAME_LAG]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00363">cube.c:363</a></div></div>
<div class="ttc" id="structdemo_html_abf27a3cd9fc6390bfb89202443aca026"><div class="ttname"><a href="structdemo.html#abf27a3cd9fc6390bfb89202443aca026">demo::graphics_queue</a></div><div class="ttdeci">VkQueue graphics_queue</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00359">cube.c:359</a></div></div>
<div class="ttc" id="structdemo_html_a304121602ddaf81bb53f28c856ea335f"><div class="ttname"><a href="structdemo.html#a304121602ddaf81bb53f28c856ea335f">demo::memory_properties</a></div><div class="ttdeci">VkPhysicalDeviceMemoryProperties memory_properties</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00368">cube.c:368</a></div></div>
<div class="ttc" id="structdemo_html_ab86850eb961f077b1c65bbfa50f4111e"><div class="ttname"><a href="structdemo.html#ab86850eb961f077b1c65bbfa50f4111e">demo::draw_complete_semaphores</a></div><div class="ttdeci">VkSemaphore draw_complete_semaphores[FRAME_LAG]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00364">cube.c:364</a></div></div>
<div class="ttc" id="structdemo_html_a6295c3f9292dfc7484b71ef464cd1bda"><div class="ttname"><a href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">demo::surface</a></div><div class="ttdeci">VkSurfaceKHR surface</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00338">cube.c:338</a></div></div>
<div class="ttc" id="structdemo_html_ad1d805df20add2d34e6f9a5d9e2f7fd9"><div class="ttname"><a href="structdemo.html#ad1d805df20add2d34e6f9a5d9e2f7fd9">demo::queue_props</a></div><div class="ttdeci">VkQueueFamilyProperties * queue_props</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00367">cube.c:367</a></div></div>
<div class="ttc" id="structdemo_html_a857402ee014d13bb9fa5a9dfa46da5ff"><div class="ttname"><a href="structdemo.html#a857402ee014d13bb9fa5a9dfa46da5ff">demo::fpGetPhysicalDeviceSurfaceFormatsKHR</a></div><div class="ttdeci">PFN_vkGetPhysicalDeviceSurfaceFormatsKHR fpGetPhysicalDeviceSurfaceFormatsKHR</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00381">cube.c:381</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="cube_8c_html_ac570d41514a55546127adf73c8faef66"><div class="ttname"><a href="cube_8c.html#ac570d41514a55546127adf73c8faef66">demo_create_device</a></div><div class="ttdeci">static void demo_create_device(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l03243">cube.c:3243</a></div></div>
<div class="ttc" id="structdemo_html_a4f271161fb166d561f5da630dd0de222"><div class="ttname"><a href="structdemo.html#a4f271161fb166d561f5da630dd0de222">demo::connection</a></div><div class="ttdeci">HINSTANCE connection</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00308">cube.c:308</a></div></div>
<div class="ttc" id="structdemo_html_af46680459ee64109f859980ee9165a94"><div class="ttname"><a href="structdemo.html#af46680459ee64109f859980ee9165a94">demo::fpGetPhysicalDeviceSurfaceSupportKHR</a></div><div class="ttdeci">PFN_vkGetPhysicalDeviceSurfaceSupportKHR fpGetPhysicalDeviceSurfaceSupportKHR</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00379">cube.c:379</a></div></div>
<div class="ttc" id="structdemo_html_a801600c468658c9dc656ef904f429f15"><div class="ttname"><a href="structdemo.html#a801600c468658c9dc656ef904f429f15">demo::curFrame</a></div><div class="ttdeci">int32_t curFrame</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00433">cube.c:433</a></div></div>
<div class="ttc" id="structdemo_html_a9f7e94f1331e93955bcfdfb6596fedc1"><div class="ttname"><a href="structdemo.html#a9f7e94f1331e93955bcfdfb6596fedc1">demo::graphics_queue_family_index</a></div><div class="ttdeci">uint32_t graphics_queue_family_index</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00361">cube.c:361</a></div></div>
<div class="ttc" id="structdemo_html_a36dbf6fc5ca79840c712e27c47123f2c"><div class="ttname"><a href="structdemo.html#a36dbf6fc5ca79840c712e27c47123f2c">demo::color_space</a></div><div class="ttdeci">VkColorSpaceKHR color_space</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00377">cube.c:377</a></div></div>
<div class="ttc" id="structdemo_html_a8d379997ae0b03bfedacc9ca8145dd71"><div class="ttname"><a href="structdemo.html#a8d379997ae0b03bfedacc9ca8145dd71">demo::format</a></div><div class="ttdeci">VkFormat format</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00376">cube.c:376</a></div></div>
<div class="ttc" id="structdemo_html_a1238f2cb459a1255d322dd141f2f4adb"><div class="ttname"><a href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">demo::gpu</a></div><div class="ttdeci">VkPhysicalDevice gpu</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00357">cube.c:357</a></div></div>
<div class="ttc" id="structdemo_html_a894fb54cff1b88236c70332f35c40e04"><div class="ttname"><a href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">demo::separate_present_queue</a></div><div class="ttdeci">bool separate_present_queue</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00341">cube.c:341</a></div></div>
<div class="ttc" id="structdemo_html_ab5d90de1697320345806250bcc4bd51b"><div class="ttname"><a href="structdemo.html#ab5d90de1697320345806250bcc4bd51b">demo::queue_family_count</a></div><div class="ttdeci">uint32_t queue_family_count</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00450">cube.c:450</a></div></div>
<div class="ttc" id="cube_8c_html_a28fe14fddb8a99da1b8a644308d1a901"><div class="ttname"><a href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a></div><div class="ttdeci">#define ERR_EXIT(err_msg, err_class)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00123">cube.c:123</a></div></div>
<div class="ttc" id="structdemo_html_ad5052f1e07e9c04deaa9a1f8e4e13654"><div class="ttname"><a href="structdemo.html#ad5052f1e07e9c04deaa9a1f8e4e13654">demo::inst</a></div><div class="ttdeci">VkInstance inst</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00356">cube.c:356</a></div></div>
<div class="ttc" id="structdemo_html_afd529ef5cf4122199b49e313c57c054a"><div class="ttname"><a href="structdemo.html#afd529ef5cf4122199b49e313c57c054a">demo::present_queue</a></div><div class="ttdeci">VkQueue present_queue</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00360">cube.c:360</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
<div class="ttc" id="structdemo_html_a096ec114abccb153f4043e8b1c75be22"><div class="ttname"><a href="structdemo.html#a096ec114abccb153f4043e8b1c75be22">demo::window</a></div><div class="ttdeci">HWND window</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00310">cube.c:310</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ab8af4815cac383b0436928fe474b98b3_cgraph.png" border="0" usemap="#cube_8c_ab8af4815cac383b0436928fe474b98b3_cgraph" alt=""/></div>
<map name="cube_8c_ab8af4815cac383b0436928fe474b98b3_cgraph" id="cube_8c_ab8af4815cac383b0436928fe474b98b3_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#ac570d41514a55546127adf73c8faef66" title="demo_create_device" alt="" coords="219,5,359,32"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ab8af4815cac383b0436928fe474b98b3_icgraph.png" border="0" usemap="#cube_8c_ab8af4815cac383b0436928fe474b98b3_icgraph" alt=""/></div>
<map name="cube_8c_ab8af4815cac383b0436928fe474b98b3_icgraph" id="cube_8c_ab8af4815cac383b0436928fe474b98b3_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="219,5,292,32"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a0fcfc933d495ab4fcf98493677e3d8da"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_prepare </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l02099">2099</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00296">SwapchainImageResources::cmd</a>, <a class="el" href="cube_8c_source.html#l00412">demo::cmd</a>, <a class="el" href="cube_8c_source.html#l00397">demo::cmd_pool</a>, <a class="el" href="cube_8c_source.html#l00449">demo::current_buffer</a>, <a class="el" href="cube_8c_source.html#l00836">demo_build_image_ownership_cmd()</a>, <a class="el" href="cube_8c_source.html#l01568">demo_destroy_texture_image()</a>, <a class="el" href="cube_8c_source.html#l00703">demo_draw_build_cmd()</a>, <a class="el" href="cube_8c_source.html#l00614">demo_flush_init_cmd()</a>, <a class="el" href="cube_8c_source.html#l01171">demo_prepare_buffers()</a>, <a class="el" href="cube_8c_source.html#l01680">demo_prepare_cube_data_buffers()</a>, <a class="el" href="cube_8c_source.html#l01393">demo_prepare_depth()</a>, <a class="el" href="cube_8c_source.html#l01743">demo_prepare_descriptor_layout()</a>, <a class="el" href="cube_8c_source.html#l02004">demo_prepare_descriptor_pool()</a>, <a class="el" href="cube_8c_source.html#l02030">demo_prepare_descriptor_set()</a>, <a class="el" href="cube_8c_source.html#l02075">demo_prepare_framebuffers()</a>, <a class="el" href="cube_8c_source.html#l01887">demo_prepare_pipeline()</a>, <a class="el" href="cube_8c_source.html#l01784">demo_prepare_render_pass()</a>, <a class="el" href="cube_8c_source.html#l01574">demo_prepare_textures()</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00361">demo::graphics_queue_family_index</a>, <a class="el" href="cube_8c_source.html#l00297">SwapchainImageResources::graphics_to_present_cmd</a>, <a class="el" href="cube_8c_source.html#l00163">texture_object::image</a>, <a class="el" href="cube_8c_source.html#l00342">demo::is_minimized</a>, <a class="el" href="cube_8c_source.html#l00339">demo::prepared</a>, <a class="el" href="cube_8c_source.html#l00398">demo::present_cmd_pool</a>, <a class="el" href="cube_8c_source.html#l00362">demo::present_queue_family_index</a>, <a class="el" href="cube_8c_source.html#l00341">demo::separate_present_queue</a>, <a class="el" href="cube_8c_source.html#l00410">demo::staging_texture</a>, <a class="el" href="cube_8c_source.html#l00392">demo::swapchain_image_resources</a>, <a class="el" href="cube_8c_source.html#l00390">demo::swapchainImageCount</a>, and <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02283">demo_resize()</a>, and <a class="el" href="cube_8c_source.html#l03702">WinMain()</a>.</p>
<div class="fragment"><div class="line"><a name="l02099"></a><span class="lineno"> 2099</span>&#160;                                            {</div><div class="line"><a name="l02100"></a><span class="lineno"> 2100</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l02101"></a><span class="lineno"> 2101</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#af527d51e6fafb65fec23e3b95b622b93">cmd_pool</a> == VK_NULL_HANDLE) {</div><div class="line"><a name="l02102"></a><span class="lineno"> 2102</span>&#160;        <span class="keyword">const</span> VkCommandPoolCreateInfo cmd_pool_info = {</div><div class="line"><a name="l02103"></a><span class="lineno"> 2103</span>&#160;            .sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,</div><div class="line"><a name="l02104"></a><span class="lineno"> 2104</span>&#160;            .pNext = NULL,</div><div class="line"><a name="l02105"></a><span class="lineno"> 2105</span>&#160;            .queueFamilyIndex = demo-&gt;<a class="code" href="structdemo.html#a9f7e94f1331e93955bcfdfb6596fedc1">graphics_queue_family_index</a>,</div><div class="line"><a name="l02106"></a><span class="lineno"> 2106</span>&#160;            .flags = 0,</div><div class="line"><a name="l02107"></a><span class="lineno"> 2107</span>&#160;        };</div><div class="line"><a name="l02108"></a><span class="lineno"> 2108</span>&#160;        err = vkCreateCommandPool(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;cmd_pool_info, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#af527d51e6fafb65fec23e3b95b622b93">cmd_pool</a>);</div><div class="line"><a name="l02109"></a><span class="lineno"> 2109</span>&#160;        assert(!err);</div><div class="line"><a name="l02110"></a><span class="lineno"> 2110</span>&#160;    }</div><div class="line"><a name="l02111"></a><span class="lineno"> 2111</span>&#160;</div><div class="line"><a name="l02112"></a><span class="lineno"> 2112</span>&#160;    <span class="keyword">const</span> VkCommandBufferAllocateInfo cmd = {</div><div class="line"><a name="l02113"></a><span class="lineno"> 2113</span>&#160;        .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,</div><div class="line"><a name="l02114"></a><span class="lineno"> 2114</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l02115"></a><span class="lineno"> 2115</span>&#160;        .commandPool = demo-&gt;<a class="code" href="structdemo.html#af527d51e6fafb65fec23e3b95b622b93">cmd_pool</a>,</div><div class="line"><a name="l02116"></a><span class="lineno"> 2116</span>&#160;        .level = VK_COMMAND_BUFFER_LEVEL_PRIMARY,</div><div class="line"><a name="l02117"></a><span class="lineno"> 2117</span>&#160;        .commandBufferCount = 1,</div><div class="line"><a name="l02118"></a><span class="lineno"> 2118</span>&#160;    };</div><div class="line"><a name="l02119"></a><span class="lineno"> 2119</span>&#160;    err = vkAllocateCommandBuffers(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;cmd, &amp;demo-&gt;<a class="code" href="structdemo.html#a5f52e6ec2780b7c5395983efe51bcb34">cmd</a>);</div><div class="line"><a name="l02120"></a><span class="lineno"> 2120</span>&#160;    assert(!err);</div><div class="line"><a name="l02121"></a><span class="lineno"> 2121</span>&#160;    VkCommandBufferBeginInfo cmd_buf_info = {</div><div class="line"><a name="l02122"></a><span class="lineno"> 2122</span>&#160;        .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,</div><div class="line"><a name="l02123"></a><span class="lineno"> 2123</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l02124"></a><span class="lineno"> 2124</span>&#160;        .flags = 0,</div><div class="line"><a name="l02125"></a><span class="lineno"> 2125</span>&#160;        .pInheritanceInfo = NULL,</div><div class="line"><a name="l02126"></a><span class="lineno"> 2126</span>&#160;    };</div><div class="line"><a name="l02127"></a><span class="lineno"> 2127</span>&#160;    err = vkBeginCommandBuffer(demo-&gt;<a class="code" href="structdemo.html#a5f52e6ec2780b7c5395983efe51bcb34">cmd</a>, &amp;cmd_buf_info);</div><div class="line"><a name="l02128"></a><span class="lineno"> 2128</span>&#160;    assert(!err);</div><div class="line"><a name="l02129"></a><span class="lineno"> 2129</span>&#160;</div><div class="line"><a name="l02130"></a><span class="lineno"> 2130</span>&#160;    <a class="code" href="cube_8c.html#a0c4cc92dc1a3456d6cca76e3187f2010">demo_prepare_buffers</a>(demo);</div><div class="line"><a name="l02131"></a><span class="lineno"> 2131</span>&#160;</div><div class="line"><a name="l02132"></a><span class="lineno"> 2132</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#ac2570a83ce706add3b8a07673237f30c">is_minimized</a>) {</div><div class="line"><a name="l02133"></a><span class="lineno"> 2133</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a37de313a90cfadb40755d35e8d70f704">prepared</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l02134"></a><span class="lineno"> 2134</span>&#160;        <span class="keywordflow">return</span>;</div><div class="line"><a name="l02135"></a><span class="lineno"> 2135</span>&#160;    }</div><div class="line"><a name="l02136"></a><span class="lineno"> 2136</span>&#160;</div><div class="line"><a name="l02137"></a><span class="lineno"> 2137</span>&#160;    <a class="code" href="cube_8c.html#a3569c83afeb4ecc4d8d797af29ce89ed">demo_prepare_depth</a>(demo);</div><div class="line"><a name="l02138"></a><span class="lineno"> 2138</span>&#160;    <a class="code" href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7">demo_prepare_textures</a>(demo);</div><div class="line"><a name="l02139"></a><span class="lineno"> 2139</span>&#160;    <a class="code" href="cube_8c.html#a21da8dc23d75bc75b5dbe7dd01130739">demo_prepare_cube_data_buffers</a>(demo);</div><div class="line"><a name="l02140"></a><span class="lineno"> 2140</span>&#160;</div><div class="line"><a name="l02141"></a><span class="lineno"> 2141</span>&#160;    <a class="code" href="cube_8c.html#a36308c10e305d94d63e96fc82be78950">demo_prepare_descriptor_layout</a>(demo);</div><div class="line"><a name="l02142"></a><span class="lineno"> 2142</span>&#160;    <a class="code" href="cube_8c.html#a4ac6098487e1fc2305847f666891cdec">demo_prepare_render_pass</a>(demo);</div><div class="line"><a name="l02143"></a><span class="lineno"> 2143</span>&#160;    <a class="code" href="cube_8c.html#aa80cd8877b6b5d20217c451b207ca9d9">demo_prepare_pipeline</a>(demo);</div><div class="line"><a name="l02144"></a><span class="lineno"> 2144</span>&#160;</div><div class="line"><a name="l02145"></a><span class="lineno"> 2145</span>&#160;    <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>; i++) {</div><div class="line"><a name="l02146"></a><span class="lineno"> 2146</span>&#160;        err = vkAllocateCommandBuffers(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;cmd, &amp;demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a01f3d0317c7802a763e58e9817b7f3c2">cmd</a>);</div><div class="line"><a name="l02147"></a><span class="lineno"> 2147</span>&#160;        assert(!err);</div><div class="line"><a name="l02148"></a><span class="lineno"> 2148</span>&#160;    }</div><div class="line"><a name="l02149"></a><span class="lineno"> 2149</span>&#160;</div><div class="line"><a name="l02150"></a><span class="lineno"> 2150</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">separate_present_queue</a>) {</div><div class="line"><a name="l02151"></a><span class="lineno"> 2151</span>&#160;        <span class="keyword">const</span> VkCommandPoolCreateInfo present_cmd_pool_info = {</div><div class="line"><a name="l02152"></a><span class="lineno"> 2152</span>&#160;            .sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,</div><div class="line"><a name="l02153"></a><span class="lineno"> 2153</span>&#160;            .pNext = NULL,</div><div class="line"><a name="l02154"></a><span class="lineno"> 2154</span>&#160;            .queueFamilyIndex = demo-&gt;<a class="code" href="structdemo.html#a8e9f41863731d6ab805b8d632f3d0c9d">present_queue_family_index</a>,</div><div class="line"><a name="l02155"></a><span class="lineno"> 2155</span>&#160;            .flags = 0,</div><div class="line"><a name="l02156"></a><span class="lineno"> 2156</span>&#160;        };</div><div class="line"><a name="l02157"></a><span class="lineno"> 2157</span>&#160;        err = vkCreateCommandPool(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;present_cmd_pool_info, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#acc57b4fdd35d5caf270586100354ba6c">present_cmd_pool</a>);</div><div class="line"><a name="l02158"></a><span class="lineno"> 2158</span>&#160;        assert(!err);</div><div class="line"><a name="l02159"></a><span class="lineno"> 2159</span>&#160;        <span class="keyword">const</span> VkCommandBufferAllocateInfo present_cmd_info = {</div><div class="line"><a name="l02160"></a><span class="lineno"> 2160</span>&#160;            .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,</div><div class="line"><a name="l02161"></a><span class="lineno"> 2161</span>&#160;            .pNext = NULL,</div><div class="line"><a name="l02162"></a><span class="lineno"> 2162</span>&#160;            .commandPool = demo-&gt;<a class="code" href="structdemo.html#acc57b4fdd35d5caf270586100354ba6c">present_cmd_pool</a>,</div><div class="line"><a name="l02163"></a><span class="lineno"> 2163</span>&#160;            .level = VK_COMMAND_BUFFER_LEVEL_PRIMARY,</div><div class="line"><a name="l02164"></a><span class="lineno"> 2164</span>&#160;            .commandBufferCount = 1,</div><div class="line"><a name="l02165"></a><span class="lineno"> 2165</span>&#160;        };</div><div class="line"><a name="l02166"></a><span class="lineno"> 2166</span>&#160;        <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>; i++) {</div><div class="line"><a name="l02167"></a><span class="lineno"> 2167</span>&#160;            err = vkAllocateCommandBuffers(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;present_cmd_info,</div><div class="line"><a name="l02168"></a><span class="lineno"> 2168</span>&#160;                                           &amp;demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a7dc70d5748a9ff416efe19a67ad8e8f8">graphics_to_present_cmd</a>);</div><div class="line"><a name="l02169"></a><span class="lineno"> 2169</span>&#160;            assert(!err);</div><div class="line"><a name="l02170"></a><span class="lineno"> 2170</span>&#160;            <a class="code" href="cube_8c.html#ad1571a7e9407fa30327f858d07ea6702">demo_build_image_ownership_cmd</a>(demo, i);</div><div class="line"><a name="l02171"></a><span class="lineno"> 2171</span>&#160;        }</div><div class="line"><a name="l02172"></a><span class="lineno"> 2172</span>&#160;    }</div><div class="line"><a name="l02173"></a><span class="lineno"> 2173</span>&#160;</div><div class="line"><a name="l02174"></a><span class="lineno"> 2174</span>&#160;    <a class="code" href="cube_8c.html#a4ee7f5efc65c5972db015c6be8cda380">demo_prepare_descriptor_pool</a>(demo);</div><div class="line"><a name="l02175"></a><span class="lineno"> 2175</span>&#160;    <a class="code" href="cube_8c.html#ac1957f225fabd1755a0064169fa5f6ba">demo_prepare_descriptor_set</a>(demo);</div><div class="line"><a name="l02176"></a><span class="lineno"> 2176</span>&#160;</div><div class="line"><a name="l02177"></a><span class="lineno"> 2177</span>&#160;    <a class="code" href="cube_8c.html#a3a72610dc44a370494307b568ef3abd6">demo_prepare_framebuffers</a>(demo);</div><div class="line"><a name="l02178"></a><span class="lineno"> 2178</span>&#160;</div><div class="line"><a name="l02179"></a><span class="lineno"> 2179</span>&#160;    <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>; i++) {</div><div class="line"><a name="l02180"></a><span class="lineno"> 2180</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a8ef0be14f77810d25d103241361daa30">current_buffer</a> = i;</div><div class="line"><a name="l02181"></a><span class="lineno"> 2181</span>&#160;        <a class="code" href="cube_8c.html#aa9f275ddb85f8473f44c01a00ccfba63">demo_draw_build_cmd</a>(demo, demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a01f3d0317c7802a763e58e9817b7f3c2">cmd</a>);</div><div class="line"><a name="l02182"></a><span class="lineno"> 2182</span>&#160;    }</div><div class="line"><a name="l02183"></a><span class="lineno"> 2183</span>&#160;</div><div class="line"><a name="l02184"></a><span class="lineno"> 2184</span>&#160;    <span class="comment">/*</span></div><div class="line"><a name="l02185"></a><span class="lineno"> 2185</span>&#160;<span class="comment">     * Prepare functions above may generate pipeline commands</span></div><div class="line"><a name="l02186"></a><span class="lineno"> 2186</span>&#160;<span class="comment">     * that need to be flushed before beginning the render loop.</span></div><div class="line"><a name="l02187"></a><span class="lineno"> 2187</span>&#160;<span class="comment">     */</span></div><div class="line"><a name="l02188"></a><span class="lineno"> 2188</span>&#160;    <a class="code" href="cube_8c.html#a7a35f4639d32b3ac59dd725668a363ba">demo_flush_init_cmd</a>(demo);</div><div class="line"><a name="l02189"></a><span class="lineno"> 2189</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#af368a567d73342ff5d8140bf76bd1f14">staging_texture</a>.<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a>) {</div><div class="line"><a name="l02190"></a><span class="lineno"> 2190</span>&#160;        <a class="code" href="cube_8c.html#a10612fc5c33836b531554ee572b389f2">demo_destroy_texture_image</a>(demo, &amp;demo-&gt;<a class="code" href="structdemo.html#af368a567d73342ff5d8140bf76bd1f14">staging_texture</a>);</div><div class="line"><a name="l02191"></a><span class="lineno"> 2191</span>&#160;    }</div><div class="line"><a name="l02192"></a><span class="lineno"> 2192</span>&#160;</div><div class="line"><a name="l02193"></a><span class="lineno"> 2193</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a8ef0be14f77810d25d103241361daa30">current_buffer</a> = 0;</div><div class="line"><a name="l02194"></a><span class="lineno"> 2194</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a37de313a90cfadb40755d35e8d70f704">prepared</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l02195"></a><span class="lineno"> 2195</span>&#160;}</div><div class="ttc" id="structdemo_html_a8e9f41863731d6ab805b8d632f3d0c9d"><div class="ttname"><a href="structdemo.html#a8e9f41863731d6ab805b8d632f3d0c9d">demo::present_queue_family_index</a></div><div class="ttdeci">uint32_t present_queue_family_index</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00362">cube.c:362</a></div></div>
<div class="ttc" id="cube_8c_html_a0316bd7d613330a9963098b02a6396d7"><div class="ttname"><a href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7">demo_prepare_textures</a></div><div class="ttdeci">static void demo_prepare_textures(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l01574">cube.c:1574</a></div></div>
<div class="ttc" id="structdemo_html_a37de313a90cfadb40755d35e8d70f704"><div class="ttname"><a href="structdemo.html#a37de313a90cfadb40755d35e8d70f704">demo::prepared</a></div><div class="ttdeci">bool prepared</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00339">cube.c:339</a></div></div>
<div class="ttc" id="cube_8c_html_a4ee7f5efc65c5972db015c6be8cda380"><div class="ttname"><a href="cube_8c.html#a4ee7f5efc65c5972db015c6be8cda380">demo_prepare_descriptor_pool</a></div><div class="ttdeci">static void demo_prepare_descriptor_pool(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l02004">cube.c:2004</a></div></div>
<div class="ttc" id="structdemo_html_a337380c3a804d2cb24e6ce3a5ecc80e5"><div class="ttname"><a href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">demo::swapchainImageCount</a></div><div class="ttdeci">uint32_t swapchainImageCount</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00390">cube.c:390</a></div></div>
<div class="ttc" id="cube_8c_html_a3569c83afeb4ecc4d8d797af29ce89ed"><div class="ttname"><a href="cube_8c.html#a3569c83afeb4ecc4d8d797af29ce89ed">demo_prepare_depth</a></div><div class="ttdeci">static void demo_prepare_depth(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l01393">cube.c:1393</a></div></div>
<div class="ttc" id="cube_8c_html_a3a72610dc44a370494307b568ef3abd6"><div class="ttname"><a href="cube_8c.html#a3a72610dc44a370494307b568ef3abd6">demo_prepare_framebuffers</a></div><div class="ttdeci">static void demo_prepare_framebuffers(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l02075">cube.c:2075</a></div></div>
<div class="ttc" id="cube_8c_html_aa80cd8877b6b5d20217c451b207ca9d9"><div class="ttname"><a href="cube_8c.html#aa80cd8877b6b5d20217c451b207ca9d9">demo_prepare_pipeline</a></div><div class="ttdeci">static void demo_prepare_pipeline(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l01887">cube.c:1887</a></div></div>
<div class="ttc" id="structdemo_html_af527d51e6fafb65fec23e3b95b622b93"><div class="ttname"><a href="structdemo.html#af527d51e6fafb65fec23e3b95b622b93">demo::cmd_pool</a></div><div class="ttdeci">VkCommandPool cmd_pool</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00397">cube.c:397</a></div></div>
<div class="ttc" id="structdemo_html_a139cab94cb0a578562759d7f315ca0b5"><div class="ttname"><a href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">demo::swapchain_image_resources</a></div><div class="ttdeci">SwapchainImageResources * swapchain_image_resources</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00392">cube.c:392</a></div></div>
<div class="ttc" id="cube_8c_html_a4ac6098487e1fc2305847f666891cdec"><div class="ttname"><a href="cube_8c.html#a4ac6098487e1fc2305847f666891cdec">demo_prepare_render_pass</a></div><div class="ttdeci">static void demo_prepare_render_pass(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l01784">cube.c:1784</a></div></div>
<div class="ttc" id="structdemo_html_af368a567d73342ff5d8140bf76bd1f14"><div class="ttname"><a href="structdemo.html#af368a567d73342ff5d8140bf76bd1f14">demo::staging_texture</a></div><div class="ttdeci">struct texture_object staging_texture</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00410">cube.c:410</a></div></div>
<div class="ttc" id="cube_8c_html_a36308c10e305d94d63e96fc82be78950"><div class="ttname"><a href="cube_8c.html#a36308c10e305d94d63e96fc82be78950">demo_prepare_descriptor_layout</a></div><div class="ttdeci">static void demo_prepare_descriptor_layout(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l01743">cube.c:1743</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="cube_8c_html_a7a35f4639d32b3ac59dd725668a363ba"><div class="ttname"><a href="cube_8c.html#a7a35f4639d32b3ac59dd725668a363ba">demo_flush_init_cmd</a></div><div class="ttdeci">static void demo_flush_init_cmd(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00614">cube.c:614</a></div></div>
<div class="ttc" id="structdemo_html_ac2570a83ce706add3b8a07673237f30c"><div class="ttname"><a href="structdemo.html#ac2570a83ce706add3b8a07673237f30c">demo::is_minimized</a></div><div class="ttdeci">bool is_minimized</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00342">cube.c:342</a></div></div>
<div class="ttc" id="cube_8c_html_a0c4cc92dc1a3456d6cca76e3187f2010"><div class="ttname"><a href="cube_8c.html#a0c4cc92dc1a3456d6cca76e3187f2010">demo_prepare_buffers</a></div><div class="ttdeci">static void demo_prepare_buffers(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l01171">cube.c:1171</a></div></div>
<div class="ttc" id="cube_8c_html_ad1571a7e9407fa30327f858d07ea6702"><div class="ttname"><a href="cube_8c.html#ad1571a7e9407fa30327f858d07ea6702">demo_build_image_ownership_cmd</a></div><div class="ttdeci">void demo_build_image_ownership_cmd(struct demo *demo, int i)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00836">cube.c:836</a></div></div>
<div class="ttc" id="structdemo_html_acc57b4fdd35d5caf270586100354ba6c"><div class="ttname"><a href="structdemo.html#acc57b4fdd35d5caf270586100354ba6c">demo::present_cmd_pool</a></div><div class="ttdeci">VkCommandPool present_cmd_pool</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00398">cube.c:398</a></div></div>
<div class="ttc" id="structdemo_html_a9f7e94f1331e93955bcfdfb6596fedc1"><div class="ttname"><a href="structdemo.html#a9f7e94f1331e93955bcfdfb6596fedc1">demo::graphics_queue_family_index</a></div><div class="ttdeci">uint32_t graphics_queue_family_index</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00361">cube.c:361</a></div></div>
<div class="ttc" id="cube_8c_html_aa9f275ddb85f8473f44c01a00ccfba63"><div class="ttname"><a href="cube_8c.html#aa9f275ddb85f8473f44c01a00ccfba63">demo_draw_build_cmd</a></div><div class="ttdeci">static void demo_draw_build_cmd(struct demo *demo, VkCommandBuffer cmd_buf)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00703">cube.c:703</a></div></div>
<div class="ttc" id="cube_8c_html_a10612fc5c33836b531554ee572b389f2"><div class="ttname"><a href="cube_8c.html#a10612fc5c33836b531554ee572b389f2">demo_destroy_texture_image</a></div><div class="ttdeci">static void demo_destroy_texture_image(struct demo *demo, struct texture_object *tex_objs)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l01568">cube.c:1568</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a01f3d0317c7802a763e58e9817b7f3c2"><div class="ttname"><a href="struct_swapchain_image_resources.html#a01f3d0317c7802a763e58e9817b7f3c2">SwapchainImageResources::cmd</a></div><div class="ttdeci">VkCommandBuffer cmd</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00296">cube.c:296</a></div></div>
<div class="ttc" id="cube_8c_html_ac1957f225fabd1755a0064169fa5f6ba"><div class="ttname"><a href="cube_8c.html#ac1957f225fabd1755a0064169fa5f6ba">demo_prepare_descriptor_set</a></div><div class="ttdeci">static void demo_prepare_descriptor_set(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l02030">cube.c:2030</a></div></div>
<div class="ttc" id="structdemo_html_a894fb54cff1b88236c70332f35c40e04"><div class="ttname"><a href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">demo::separate_present_queue</a></div><div class="ttdeci">bool separate_present_queue</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00341">cube.c:341</a></div></div>
<div class="ttc" id="structdemo_html_a8ef0be14f77810d25d103241361daa30"><div class="ttname"><a href="structdemo.html#a8ef0be14f77810d25d103241361daa30">demo::current_buffer</a></div><div class="ttdeci">uint32_t current_buffer</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00449">cube.c:449</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a7dc70d5748a9ff416efe19a67ad8e8f8"><div class="ttname"><a href="struct_swapchain_image_resources.html#a7dc70d5748a9ff416efe19a67ad8e8f8">SwapchainImageResources::graphics_to_present_cmd</a></div><div class="ttdeci">VkCommandBuffer graphics_to_present_cmd</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00297">cube.c:297</a></div></div>
<div class="ttc" id="structtexture__object_html_abffe0a242253611e95ee13d9c112e01c"><div class="ttname"><a href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">texture_object::image</a></div><div class="ttdeci">VkImage image</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00163">cube.c:163</a></div></div>
<div class="ttc" id="structdemo_html_a5f52e6ec2780b7c5395983efe51bcb34"><div class="ttname"><a href="structdemo.html#a5f52e6ec2780b7c5395983efe51bcb34">demo::cmd</a></div><div class="ttdeci">VkCommandBuffer cmd</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00412">cube.c:412</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
<div class="ttc" id="cube_8c_html_a21da8dc23d75bc75b5dbe7dd01130739"><div class="ttname"><a href="cube_8c.html#a21da8dc23d75bc75b5dbe7dd01130739">demo_prepare_cube_data_buffers</a></div><div class="ttdeci">void demo_prepare_cube_data_buffers(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l01680">cube.c:1680</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a0fcfc933d495ab4fcf98493677e3d8da_cgraph.png" border="0" usemap="#cube_8c_a0fcfc933d495ab4fcf98493677e3d8da_cgraph" alt=""/></div>
<map name="cube_8c_a0fcfc933d495ab4fcf98493677e3d8da_cgraph" id="cube_8c_a0fcfc933d495ab4fcf98493677e3d8da_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#ad1571a7e9407fa30327f858d07ea6702" title="demo_build_image_ownership_cmd" alt="" coords="157,5,384,32"/>
<area shape="rect" id="node3" href="cube_8c.html#a10612fc5c33836b531554ee572b389f2" title="demo_destroy_texture\l_image" alt="" coords="195,57,346,98"/>
<area shape="rect" id="node4" href="cube_8c.html#aa9f275ddb85f8473f44c01a00ccfba63" title="demo_draw_build_cmd" alt="" coords="193,123,348,149"/>
<area shape="rect" id="node5" href="cube_8c.html#a7a35f4639d32b3ac59dd725668a363ba" title="demo_flush_init_cmd" alt="" coords="199,173,343,200"/>
<area shape="rect" id="node6" href="cube_8c.html#a0c4cc92dc1a3456d6cca76e3187f2010" title="demo_prepare_buffers" alt="" coords="196,224,345,251"/>
<area shape="rect" id="node7" href="cube_8c.html#a21da8dc23d75bc75b5dbe7dd01130739" title="demo_prepare_cube_data\l_buffers" alt="" coords="432,255,603,297"/>
<area shape="rect" id="node9" href="cube_8c.html#a3569c83afeb4ecc4d8d797af29ce89ed" title="demo_prepare_depth" alt="" coords="446,321,589,348"/>
<area shape="rect" id="node10" href="cube_8c.html#a36308c10e305d94d63e96fc82be78950" title="demo_prepare_descriptor\l_layout" alt="" coords="187,427,355,469"/>
<area shape="rect" id="node11" href="cube_8c.html#a4ee7f5efc65c5972db015c6be8cda380" title="demo_prepare_descriptor_pool" alt="" coords="171,493,370,520"/>
<area shape="rect" id="node12" href="cube_8c.html#ac1957f225fabd1755a0064169fa5f6ba" title="demo_prepare_descriptor_set" alt="" coords="174,544,367,571"/>
<area shape="rect" id="node13" href="cube_8c.html#a3a72610dc44a370494307b568ef3abd6" title="demo_prepare_framebuffers" alt="" coords="180,595,361,621"/>
<area shape="rect" id="node14" href="cube_8c.html#aa80cd8877b6b5d20217c451b207ca9d9" title="demo_prepare_pipeline" alt="" coords="193,645,348,672"/>
<area shape="rect" id="node18" href="cube_8c.html#a4ac6098487e1fc2305847f666891cdec" title="demo_prepare_render_pass" alt="" coords="179,696,362,723"/>
<area shape="rect" id="node19" href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7" title="demo_prepare_textures" alt="" coords="191,376,350,403"/>
<area shape="rect" id="node8" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b" title="memory_type_from_properties" alt="" coords="651,321,848,348"/>
<area shape="rect" id="node15" href="cube_8c.html#ab1d134177a8964ce85593b229fc7f688" title="demo_prepare_vs" alt="" coords="456,620,579,647"/>
<area shape="rect" id="node17" href="cube_8c.html#ab89d9436b88fd3dea5de8cb03de51e94" title="demo_prepare_fs" alt="" coords="457,671,578,697"/>
<area shape="rect" id="node16" href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c" title="demo_prepare_shader\l_module" alt="" coords="674,638,825,679"/>
<area shape="rect" id="node20" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731" title="demo_prepare_texture\l_image" alt="" coords="442,373,593,414"/>
<area shape="rect" id="node22" href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8" title="demo_set_image_layout" alt="" coords="436,439,599,465"/>
<area shape="rect" id="node21" href="cube_8c.html#add4fd1e03edd51503c9c554e77a042fa" title="loadTexture" alt="" coords="705,380,794,407"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a0fcfc933d495ab4fcf98493677e3d8da_icgraph.png" border="0" usemap="#cube_8c_a0fcfc933d495ab4fcf98493677e3d8da_icgraph" alt=""/></div>
<map name="cube_8c_a0fcfc933d495ab4fcf98493677e3d8da_icgraph" id="cube_8c_a0fcfc933d495ab4fcf98493677e3d8da_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="157,93,253,120"/>
<area shape="rect" id="node7" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1260,119,1333,145"/>
<area shape="rect" id="node3" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="301,93,428,120"/>
<area shape="rect" id="node5" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="679,119,767,145"/>
<area shape="rect" id="node6" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1065,119,1212,145"/>
<area shape="rect" id="node9" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="941,245,1017,272"/>
<area shape="rect" id="node4" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="476,93,631,120"/>
<area shape="rect" id="node8" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="815,156,893,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a0c4cc92dc1a3456d6cca76e3187f2010"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_prepare_buffers </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l01171">1171</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00073">ARRAY_SIZE</a>, <a class="el" href="cube_8c_source.html#l00377">demo::color_space</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00123">ERR_EXIT</a>, <a class="el" href="cube_8c_source.html#l00376">demo::format</a>, <a class="el" href="cube_8c_source.html#l00383">demo::fpCreateSwapchainKHR</a>, <a class="el" href="cube_8c_source.html#l00384">demo::fpDestroySwapchainKHR</a>, <a class="el" href="cube_8c_source.html#l00380">demo::fpGetPhysicalDeviceSurfaceCapabilitiesKHR</a>, <a class="el" href="cube_8c_source.html#l00382">demo::fpGetPhysicalDeviceSurfacePresentModesKHR</a>, <a class="el" href="cube_8c_source.html#l00388">demo::fpGetRefreshCycleDurationGOOGLE</a>, <a class="el" href="cube_8c_source.html#l00385">demo::fpGetSwapchainImagesKHR</a>, <a class="el" href="cube_8c_source.html#l00357">demo::gpu</a>, <a class="el" href="cube_8c_source.html#l00375">demo::height</a>, <a class="el" href="cube_8c_source.html#l00295">SwapchainImageResources::image</a>, <a class="el" href="cube_8c_source.html#l00342">demo::is_minimized</a>, <a class="el" href="cube_8c_source.html#l00352">demo::next_present_id</a>, <a class="el" href="cube_8c_source.html#l00393">demo::presentMode</a>, <a class="el" href="cube_8c_source.html#l00351">demo::prev_desired_present_time</a>, <a class="el" href="cube_8c_source.html#l00348">demo::refresh_duration</a>, <a class="el" href="cube_8c_source.html#l00349">demo::refresh_duration_multiplier</a>, <a class="el" href="cube_8c_source.html#l00338">demo::surface</a>, <a class="el" href="cube_8c_source.html#l00391">demo::swapchain</a>, <a class="el" href="cube_8c_source.html#l00392">demo::swapchain_image_resources</a>, <a class="el" href="cube_8c_source.html#l00390">demo::swapchainImageCount</a>, <a class="el" href="cube_8c_source.html#l00347">demo::syncd_with_actual_presents</a>, <a class="el" href="cube_8c_source.html#l00350">demo::target_IPD</a>, <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>, <a class="el" href="cube_8c_source.html#l00298">SwapchainImageResources::view</a>, <a class="el" href="cube_8c_source.html#l00346">demo::VK_GOOGLE_display_timing_enabled</a>, and <a class="el" href="cube_8c_source.html#l00375">demo::width</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>.</p>
<div class="fragment"><div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>&#160;                                                    {</div><div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>&#160;    VkSwapchainKHR oldSwapchain = demo-&gt;<a class="code" href="structdemo.html#a29b10893f1569e17a99027963c2fed3b">swapchain</a>;</div><div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>&#160;</div><div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>&#160;    <span class="comment">// Check the surface capabilities and formats</span></div><div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>&#160;    VkSurfaceCapabilitiesKHR surfCapabilities;</div><div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>&#160;    err = demo-&gt;<a class="code" href="structdemo.html#a2b15db3daa14fd7897246a54ff95f9c5">fpGetPhysicalDeviceSurfaceCapabilitiesKHR</a>(demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a>, demo-&gt;<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a>, &amp;surfCapabilities);</div><div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>&#160;    assert(!err);</div><div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>&#160;</div><div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>&#160;    uint32_t presentModeCount;</div><div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>&#160;    err = demo-&gt;<a class="code" href="structdemo.html#ac403bc84bcb217a85f81ed0168f35b24">fpGetPhysicalDeviceSurfacePresentModesKHR</a>(demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a>, demo-&gt;<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a>, &amp;presentModeCount, NULL);</div><div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>&#160;    assert(!err);</div><div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>&#160;    VkPresentModeKHR *presentModes = (VkPresentModeKHR *)malloc(presentModeCount * <span class="keyword">sizeof</span>(VkPresentModeKHR));</div><div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>&#160;    assert(presentModes);</div><div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>&#160;    err = demo-&gt;<a class="code" href="structdemo.html#ac403bc84bcb217a85f81ed0168f35b24">fpGetPhysicalDeviceSurfacePresentModesKHR</a>(demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a>, demo-&gt;<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a>, &amp;presentModeCount, presentModes);</div><div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>&#160;    assert(!err);</div><div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>&#160;</div><div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>&#160;    VkExtent2D swapchainExtent;</div><div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>&#160;    <span class="comment">// width and height are either both 0xFFFFFFFF, or both not 0xFFFFFFFF.</span></div><div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>&#160;    <span class="keywordflow">if</span> (surfCapabilities.currentExtent.width == 0xFFFFFFFF) {</div><div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>&#160;        <span class="comment">// If the surface size is undefined, the size is set to the size</span></div><div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>&#160;        <span class="comment">// of the images requested, which must fit within the minimum and</span></div><div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>&#160;        <span class="comment">// maximum values.</span></div><div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>&#160;        swapchainExtent.width = demo-&gt;<a class="code" href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">width</a>;</div><div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>&#160;        swapchainExtent.height = demo-&gt;<a class="code" href="structdemo.html#a471d07293ae638531f808771c9975c07">height</a>;</div><div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>&#160;</div><div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>&#160;        <span class="keywordflow">if</span> (swapchainExtent.width &lt; surfCapabilities.minImageExtent.width) {</div><div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>&#160;            swapchainExtent.width = surfCapabilities.minImageExtent.width;</div><div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (swapchainExtent.width &gt; surfCapabilities.maxImageExtent.width) {</div><div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>&#160;            swapchainExtent.width = surfCapabilities.maxImageExtent.width;</div><div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>&#160;        }</div><div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>&#160;</div><div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>&#160;        <span class="keywordflow">if</span> (swapchainExtent.height &lt; surfCapabilities.minImageExtent.height) {</div><div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>&#160;            swapchainExtent.height = surfCapabilities.minImageExtent.height;</div><div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (swapchainExtent.height &gt; surfCapabilities.maxImageExtent.height) {</div><div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>&#160;            swapchainExtent.height = surfCapabilities.maxImageExtent.height;</div><div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>&#160;        }</div><div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>&#160;        <span class="comment">// If the surface size is defined, the swap chain size must match</span></div><div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>&#160;        swapchainExtent = surfCapabilities.currentExtent;</div><div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">width</a> = surfCapabilities.currentExtent.width;</div><div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a471d07293ae638531f808771c9975c07">height</a> = surfCapabilities.currentExtent.height;</div><div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>&#160;    }</div><div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>&#160;</div><div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">width</a> == 0 || demo-&gt;<a class="code" href="structdemo.html#a471d07293ae638531f808771c9975c07">height</a> == 0) {</div><div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#ac2570a83ce706add3b8a07673237f30c">is_minimized</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>&#160;        <span class="keywordflow">return</span>;</div><div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#ac2570a83ce706add3b8a07673237f30c">is_minimized</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>&#160;    }</div><div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>&#160;</div><div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>&#160;    <span class="comment">// The FIFO present mode is guaranteed by the spec to be supported</span></div><div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>&#160;    <span class="comment">// and to have no tearing.  It&#39;s a great default present mode to use.</span></div><div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>&#160;    VkPresentModeKHR swapchainPresentMode = VK_PRESENT_MODE_FIFO_KHR;</div><div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>&#160;</div><div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>&#160;    <span class="comment">//  There are times when you may wish to use another present mode.  The</span></div><div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>&#160;    <span class="comment">//  following code shows how to select them, and the comments provide some</span></div><div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>&#160;    <span class="comment">//  reasons you may wish to use them.</span></div><div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>&#160;    <span class="comment">//</span></div><div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>&#160;    <span class="comment">// It should be noted that Vulkan 1.0 doesn&#39;t provide a method for</span></div><div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>&#160;    <span class="comment">// synchronizing rendering with the presentation engine&#39;s display.  There</span></div><div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>&#160;    <span class="comment">// is a method provided for throttling rendering with the display, but</span></div><div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>&#160;    <span class="comment">// there are some presentation engines for which this method will not work.</span></div><div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>&#160;    <span class="comment">// If an application doesn&#39;t throttle its rendering, and if it renders much</span></div><div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>&#160;    <span class="comment">// faster than the refresh rate of the display, this can waste power on</span></div><div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>&#160;    <span class="comment">// mobile devices.  That is because power is being spent rendering images</span></div><div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>&#160;    <span class="comment">// that may never be seen.</span></div><div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>&#160;</div><div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>&#160;    <span class="comment">// VK_PRESENT_MODE_IMMEDIATE_KHR is for applications that don&#39;t care about</span></div><div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>&#160;    <span class="comment">// tearing, or have some way of synchronizing their rendering with the</span></div><div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>&#160;    <span class="comment">// display.</span></div><div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>&#160;    <span class="comment">// VK_PRESENT_MODE_MAILBOX_KHR may be useful for applications that</span></div><div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>&#160;    <span class="comment">// generally render a new presentable image every refresh cycle, but are</span></div><div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>&#160;    <span class="comment">// occasionally early.  In this case, the application wants the new image</span></div><div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>&#160;    <span class="comment">// to be displayed instead of the previously-queued-for-presentation image</span></div><div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>&#160;    <span class="comment">// that has not yet been displayed.</span></div><div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>&#160;    <span class="comment">// VK_PRESENT_MODE_FIFO_RELAXED_KHR is for applications that generally</span></div><div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>&#160;    <span class="comment">// render a new presentable image every refresh cycle, but are occasionally</span></div><div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>&#160;    <span class="comment">// late.  In this case (perhaps because of stuttering/latency concerns),</span></div><div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>&#160;    <span class="comment">// the application wants the late image to be immediately displayed, even</span></div><div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>&#160;    <span class="comment">// though that may mean some tearing.</span></div><div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>&#160;</div><div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a812091c8a029af03be7dfac45fbaadad">presentMode</a> != swapchainPresentMode) {</div><div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>&#160;        <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; presentModeCount; ++i) {</div><div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>&#160;            <span class="keywordflow">if</span> (presentModes[i] == demo-&gt;<a class="code" href="structdemo.html#a812091c8a029af03be7dfac45fbaadad">presentMode</a>) {</div><div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>&#160;                swapchainPresentMode = demo-&gt;<a class="code" href="structdemo.html#a812091c8a029af03be7dfac45fbaadad">presentMode</a>;</div><div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>&#160;            }</div><div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>&#160;        }</div><div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>&#160;    }</div><div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>&#160;    <span class="keywordflow">if</span> (swapchainPresentMode != demo-&gt;<a class="code" href="structdemo.html#a812091c8a029af03be7dfac45fbaadad">presentMode</a>) {</div><div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;Present mode specified is not supported\n&quot;</span>, <span class="stringliteral">&quot;Present mode unsupported&quot;</span>);</div><div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>&#160;    }</div><div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>&#160;</div><div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>&#160;    <span class="comment">// Determine the number of VkImages to use in the swap chain.</span></div><div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>&#160;    <span class="comment">// Application desires to acquire 3 images at a time for triple</span></div><div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>&#160;    <span class="comment">// buffering</span></div><div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>&#160;    uint32_t desiredNumOfSwapchainImages = 3;</div><div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>&#160;    <span class="keywordflow">if</span> (desiredNumOfSwapchainImages &lt; surfCapabilities.minImageCount) {</div><div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>&#160;        desiredNumOfSwapchainImages = surfCapabilities.minImageCount;</div><div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>&#160;    }</div><div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>&#160;    <span class="comment">// If maxImageCount is 0, we can ask for as many images as we want;</span></div><div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>&#160;    <span class="comment">// otherwise we&#39;re limited to maxImageCount</span></div><div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>&#160;    <span class="keywordflow">if</span> ((surfCapabilities.maxImageCount &gt; 0) &amp;&amp; (desiredNumOfSwapchainImages &gt; surfCapabilities.maxImageCount)) {</div><div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>&#160;        <span class="comment">// Application must settle for fewer images than desired:</span></div><div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>&#160;        desiredNumOfSwapchainImages = surfCapabilities.maxImageCount;</div><div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>&#160;    }</div><div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>&#160;</div><div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>&#160;    VkSurfaceTransformFlagsKHR preTransform;</div><div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>&#160;    <span class="keywordflow">if</span> (surfCapabilities.supportedTransforms &amp; VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) {</div><div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>&#160;        preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;</div><div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>&#160;        preTransform = surfCapabilities.currentTransform;</div><div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>&#160;    }</div><div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>&#160;</div><div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>&#160;    <span class="comment">// Find a supported composite alpha mode - one of these is guaranteed to be set</span></div><div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>&#160;    VkCompositeAlphaFlagBitsKHR compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;</div><div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>&#160;    VkCompositeAlphaFlagBitsKHR compositeAlphaFlags[4] = {</div><div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>&#160;        VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR,</div><div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>&#160;        VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR,</div><div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>&#160;        VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR,</div><div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>&#160;        VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR,</div><div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>&#160;    };</div><div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>&#160;    <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; <a class="code" href="cube_8c.html#a25f003de16c08a4888b69f619d70f427">ARRAY_SIZE</a>(compositeAlphaFlags); i++) {</div><div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>&#160;        <span class="keywordflow">if</span> (surfCapabilities.supportedCompositeAlpha &amp; compositeAlphaFlags[i]) {</div><div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>&#160;            compositeAlpha = compositeAlphaFlags[i];</div><div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>&#160;        }</div><div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>&#160;    }</div><div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>&#160;</div><div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>&#160;    VkSwapchainCreateInfoKHR swapchain_ci = {</div><div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>&#160;        .sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,</div><div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>&#160;        .surface = demo-&gt;<a class="code" href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">surface</a>,</div><div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>&#160;        .minImageCount = desiredNumOfSwapchainImages,</div><div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>&#160;        .imageFormat = demo-&gt;<a class="code" href="structdemo.html#a8d379997ae0b03bfedacc9ca8145dd71">format</a>,</div><div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>&#160;        .imageColorSpace = demo-&gt;<a class="code" href="structdemo.html#a36dbf6fc5ca79840c712e27c47123f2c">color_space</a>,</div><div class="line"><a name="l01308"></a><span class="lineno"> 1308</span>&#160;        .imageExtent =</div><div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>&#160;            {</div><div class="line"><a name="l01310"></a><span class="lineno"> 1310</span>&#160;                .width = swapchainExtent.width,</div><div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>&#160;                .height = swapchainExtent.height,</div><div class="line"><a name="l01312"></a><span class="lineno"> 1312</span>&#160;            },</div><div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>&#160;        .imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,</div><div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>&#160;        .preTransform = preTransform,</div><div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>&#160;        .compositeAlpha = compositeAlpha,</div><div class="line"><a name="l01316"></a><span class="lineno"> 1316</span>&#160;        .imageArrayLayers = 1,</div><div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>&#160;        .imageSharingMode = VK_SHARING_MODE_EXCLUSIVE,</div><div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>&#160;        .queueFamilyIndexCount = 0,</div><div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>&#160;        .pQueueFamilyIndices = NULL,</div><div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>&#160;        .presentMode = swapchainPresentMode,</div><div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>&#160;        .oldSwapchain = oldSwapchain,</div><div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>&#160;        .clipped = <span class="keyword">true</span>,</div><div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>&#160;    };</div><div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>&#160;    uint32_t i;</div><div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>&#160;    err = demo-&gt;<a class="code" href="structdemo.html#abd3423490a85a213090cd2b50736aebb">fpCreateSwapchainKHR</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;swapchain_ci, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a29b10893f1569e17a99027963c2fed3b">swapchain</a>);</div><div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>&#160;    assert(!err);</div><div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>&#160;</div><div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>&#160;    <span class="comment">// If we just re-created an existing swapchain, we should destroy the old</span></div><div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>&#160;    <span class="comment">// swapchain at this point.</span></div><div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>&#160;    <span class="comment">// Note: destroying the swapchain also cleans up all its associated</span></div><div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>&#160;    <span class="comment">// presentable images once the platform is done with them.</span></div><div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>&#160;    <span class="keywordflow">if</span> (oldSwapchain != VK_NULL_HANDLE) {</div><div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a08a1730bfb0fd09a5b4de50cf87c212d">fpDestroySwapchainKHR</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, oldSwapchain, NULL);</div><div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>&#160;    }</div><div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>&#160;</div><div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>&#160;    err = demo-&gt;<a class="code" href="structdemo.html#ad8d214562b109e2e08370fe0c4993c75">fpGetSwapchainImagesKHR</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a29b10893f1569e17a99027963c2fed3b">swapchain</a>, &amp;demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>, NULL);</div><div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>&#160;    assert(!err);</div><div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>&#160;</div><div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>&#160;    VkImage *swapchainImages = (VkImage *)malloc(demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a> * <span class="keyword">sizeof</span>(VkImage));</div><div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>&#160;    assert(swapchainImages);</div><div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>&#160;    err = demo-&gt;<a class="code" href="structdemo.html#ad8d214562b109e2e08370fe0c4993c75">fpGetSwapchainImagesKHR</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a29b10893f1569e17a99027963c2fed3b">swapchain</a>, &amp;demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>, swapchainImages);</div><div class="line"><a name="l01342"></a><span class="lineno"> 1342</span>&#160;    assert(!err);</div><div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>&#160;</div><div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a> =</div><div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>&#160;        (<a class="code" href="struct_swapchain_image_resources.html">SwapchainImageResources</a> *)malloc(<span class="keyword">sizeof</span>(<a class="code" href="struct_swapchain_image_resources.html">SwapchainImageResources</a>) * demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>);</div><div class="line"><a name="l01346"></a><span class="lineno"> 1346</span>&#160;    assert(demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>);</div><div class="line"><a name="l01347"></a><span class="lineno"> 1347</span>&#160;</div><div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>&#160;    <span class="keywordflow">for</span> (i = 0; i &lt; demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>; i++) {</div><div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>&#160;        VkImageViewCreateInfo color_image_view = {</div><div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>&#160;            .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,</div><div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>&#160;            .pNext = NULL,</div><div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>&#160;            .format = demo-&gt;<a class="code" href="structdemo.html#a8d379997ae0b03bfedacc9ca8145dd71">format</a>,</div><div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>&#160;            .components =</div><div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>&#160;                {</div><div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>&#160;                    .r = VK_COMPONENT_SWIZZLE_R,</div><div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>&#160;                    .g = VK_COMPONENT_SWIZZLE_G,</div><div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>&#160;                    .b = VK_COMPONENT_SWIZZLE_B,</div><div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>&#160;                    .a = VK_COMPONENT_SWIZZLE_A,</div><div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>&#160;                },</div><div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>&#160;            .subresourceRange =</div><div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>&#160;                {.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, .baseMipLevel = 0, .levelCount = 1, .baseArrayLayer = 0, .layerCount = 1},</div><div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>&#160;            .viewType = VK_IMAGE_VIEW_TYPE_2D,</div><div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>&#160;            .flags = 0,</div><div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>&#160;        };</div><div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>&#160;</div><div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a7faad0d9bcbbb48a1ac11db12f81420c">image</a> = swapchainImages[i];</div><div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>&#160;</div><div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>&#160;        color_image_view.image = demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a7faad0d9bcbbb48a1ac11db12f81420c">image</a>;</div><div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>&#160;</div><div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>&#160;        err = vkCreateImageView(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;color_image_view, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a2fc87148f25f154eaeaf7dc2cdef135d">view</a>);</div><div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>&#160;        assert(!err);</div><div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>&#160;    }</div><div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>&#160;</div><div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a31e84ca0ec847d04922fa8d1b9efacb7">VK_GOOGLE_display_timing_enabled</a>) {</div><div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>&#160;        VkRefreshCycleDurationGOOGLE rc_dur;</div><div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>&#160;        err = demo-&gt;<a class="code" href="structdemo.html#aeaefe54fec088df4f5a3080be682cf77">fpGetRefreshCycleDurationGOOGLE</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a29b10893f1569e17a99027963c2fed3b">swapchain</a>, &amp;rc_dur);</div><div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>&#160;        assert(!err);</div><div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a1311039938bb87188def4bc76ddb2948">refresh_duration</a> = rc_dur.refreshDuration;</div><div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>&#160;</div><div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a9bd68668039ac7d6230373ac6d62cc70">syncd_with_actual_presents</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>&#160;        <span class="comment">// Initially target 1X the refresh duration:</span></div><div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a6565c3c9d86ea398f943fd3f9cf7be46">target_IPD</a> = demo-&gt;<a class="code" href="structdemo.html#a1311039938bb87188def4bc76ddb2948">refresh_duration</a>;</div><div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a96fb9109cbd63ce7dffdcd45d63faef7">refresh_duration_multiplier</a> = 1;</div><div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a2a29d089e3aa3044b8aa9a42d0a696d3">prev_desired_present_time</a> = 0;</div><div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>&#160;        demo-&gt;<a class="code" href="structdemo.html#a316d35245b2cbcfb681c24a5c8b0ca9b">next_present_id</a> = 1;</div><div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>&#160;    }</div><div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>&#160;</div><div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>&#160;    <span class="keywordflow">if</span> (NULL != presentModes) {</div><div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>&#160;        free(presentModes);</div><div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>&#160;    }</div><div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>&#160;}</div><div class="ttc" id="structdemo_html_a2a29d089e3aa3044b8aa9a42d0a696d3"><div class="ttname"><a href="structdemo.html#a2a29d089e3aa3044b8aa9a42d0a696d3">demo::prev_desired_present_time</a></div><div class="ttdeci">uint64_t prev_desired_present_time</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00351">cube.c:351</a></div></div>
<div class="ttc" id="structdemo_html_a31e84ca0ec847d04922fa8d1b9efacb7"><div class="ttname"><a href="structdemo.html#a31e84ca0ec847d04922fa8d1b9efacb7">demo::VK_GOOGLE_display_timing_enabled</a></div><div class="ttdeci">bool VK_GOOGLE_display_timing_enabled</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00346">cube.c:346</a></div></div>
<div class="ttc" id="structdemo_html_a337380c3a804d2cb24e6ce3a5ecc80e5"><div class="ttname"><a href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">demo::swapchainImageCount</a></div><div class="ttdeci">uint32_t swapchainImageCount</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00390">cube.c:390</a></div></div>
<div class="ttc" id="structdemo_html_a29b10893f1569e17a99027963c2fed3b"><div class="ttname"><a href="structdemo.html#a29b10893f1569e17a99027963c2fed3b">demo::swapchain</a></div><div class="ttdeci">VkSwapchainKHR swapchain</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00391">cube.c:391</a></div></div>
<div class="ttc" id="structdemo_html_a6565c3c9d86ea398f943fd3f9cf7be46"><div class="ttname"><a href="structdemo.html#a6565c3c9d86ea398f943fd3f9cf7be46">demo::target_IPD</a></div><div class="ttdeci">uint64_t target_IPD</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00350">cube.c:350</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a2fc87148f25f154eaeaf7dc2cdef135d"><div class="ttname"><a href="struct_swapchain_image_resources.html#a2fc87148f25f154eaeaf7dc2cdef135d">SwapchainImageResources::view</a></div><div class="ttdeci">VkImageView view</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00298">cube.c:298</a></div></div>
<div class="ttc" id="structdemo_html_a471d07293ae638531f808771c9975c07"><div class="ttname"><a href="structdemo.html#a471d07293ae638531f808771c9975c07">demo::height</a></div><div class="ttdeci">int height</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="structdemo_html_a139cab94cb0a578562759d7f315ca0b5"><div class="ttname"><a href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">demo::swapchain_image_resources</a></div><div class="ttdeci">SwapchainImageResources * swapchain_image_resources</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00392">cube.c:392</a></div></div>
<div class="ttc" id="structdemo_html_ad8d214562b109e2e08370fe0c4993c75"><div class="ttname"><a href="structdemo.html#ad8d214562b109e2e08370fe0c4993c75">demo::fpGetSwapchainImagesKHR</a></div><div class="ttdeci">PFN_vkGetSwapchainImagesKHR fpGetSwapchainImagesKHR</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00385">cube.c:385</a></div></div>
<div class="ttc" id="structdemo_html_a6295c3f9292dfc7484b71ef464cd1bda"><div class="ttname"><a href="structdemo.html#a6295c3f9292dfc7484b71ef464cd1bda">demo::surface</a></div><div class="ttdeci">VkSurfaceKHR surface</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00338">cube.c:338</a></div></div>
<div class="ttc" id="cube_8c_html_a25f003de16c08a4888b69f619d70f427"><div class="ttname"><a href="cube_8c.html#a25f003de16c08a4888b69f619d70f427">ARRAY_SIZE</a></div><div class="ttdeci">#define ARRAY_SIZE(a)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00073">cube.c:73</a></div></div>
<div class="ttc" id="structdemo_html_a08a1730bfb0fd09a5b4de50cf87c212d"><div class="ttname"><a href="structdemo.html#a08a1730bfb0fd09a5b4de50cf87c212d">demo::fpDestroySwapchainKHR</a></div><div class="ttdeci">PFN_vkDestroySwapchainKHR fpDestroySwapchainKHR</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00384">cube.c:384</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a7faad0d9bcbbb48a1ac11db12f81420c"><div class="ttname"><a href="struct_swapchain_image_resources.html#a7faad0d9bcbbb48a1ac11db12f81420c">SwapchainImageResources::image</a></div><div class="ttdeci">VkImage image</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00295">cube.c:295</a></div></div>
<div class="ttc" id="structdemo_html_a2b15db3daa14fd7897246a54ff95f9c5"><div class="ttname"><a href="structdemo.html#a2b15db3daa14fd7897246a54ff95f9c5">demo::fpGetPhysicalDeviceSurfaceCapabilitiesKHR</a></div><div class="ttdeci">PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR fpGetPhysicalDeviceSurfaceCapabilitiesKHR</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00380">cube.c:380</a></div></div>
<div class="ttc" id="structdemo_html_a316d35245b2cbcfb681c24a5c8b0ca9b"><div class="ttname"><a href="structdemo.html#a316d35245b2cbcfb681c24a5c8b0ca9b">demo::next_present_id</a></div><div class="ttdeci">uint32_t next_present_id</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00352">cube.c:352</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_ac2570a83ce706add3b8a07673237f30c"><div class="ttname"><a href="structdemo.html#ac2570a83ce706add3b8a07673237f30c">demo::is_minimized</a></div><div class="ttdeci">bool is_minimized</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00342">cube.c:342</a></div></div>
<div class="ttc" id="structdemo_html_abd3423490a85a213090cd2b50736aebb"><div class="ttname"><a href="structdemo.html#abd3423490a85a213090cd2b50736aebb">demo::fpCreateSwapchainKHR</a></div><div class="ttdeci">PFN_vkCreateSwapchainKHR fpCreateSwapchainKHR</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00383">cube.c:383</a></div></div>
<div class="ttc" id="structdemo_html_a812091c8a029af03be7dfac45fbaadad"><div class="ttname"><a href="structdemo.html#a812091c8a029af03be7dfac45fbaadad">demo::presentMode</a></div><div class="ttdeci">VkPresentModeKHR presentMode</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00393">cube.c:393</a></div></div>
<div class="ttc" id="structdemo_html_a79020e20ddd6a4fe9bc9489a12d05696"><div class="ttname"><a href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">demo::width</a></div><div class="ttdeci">int width</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="structdemo_html_a9bd68668039ac7d6230373ac6d62cc70"><div class="ttname"><a href="structdemo.html#a9bd68668039ac7d6230373ac6d62cc70">demo::syncd_with_actual_presents</a></div><div class="ttdeci">bool syncd_with_actual_presents</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00347">cube.c:347</a></div></div>
<div class="ttc" id="structdemo_html_a36dbf6fc5ca79840c712e27c47123f2c"><div class="ttname"><a href="structdemo.html#a36dbf6fc5ca79840c712e27c47123f2c">demo::color_space</a></div><div class="ttdeci">VkColorSpaceKHR color_space</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00377">cube.c:377</a></div></div>
<div class="ttc" id="structdemo_html_a8d379997ae0b03bfedacc9ca8145dd71"><div class="ttname"><a href="structdemo.html#a8d379997ae0b03bfedacc9ca8145dd71">demo::format</a></div><div class="ttdeci">VkFormat format</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00376">cube.c:376</a></div></div>
<div class="ttc" id="structdemo_html_a96fb9109cbd63ce7dffdcd45d63faef7"><div class="ttname"><a href="structdemo.html#a96fb9109cbd63ce7dffdcd45d63faef7">demo::refresh_duration_multiplier</a></div><div class="ttdeci">uint64_t refresh_duration_multiplier</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00349">cube.c:349</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html"><div class="ttname"><a href="struct_swapchain_image_resources.html">SwapchainImageResources</a></div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00294">cube.c:294</a></div></div>
<div class="ttc" id="structdemo_html_a1311039938bb87188def4bc76ddb2948"><div class="ttname"><a href="structdemo.html#a1311039938bb87188def4bc76ddb2948">demo::refresh_duration</a></div><div class="ttdeci">uint64_t refresh_duration</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00348">cube.c:348</a></div></div>
<div class="ttc" id="structdemo_html_a1238f2cb459a1255d322dd141f2f4adb"><div class="ttname"><a href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">demo::gpu</a></div><div class="ttdeci">VkPhysicalDevice gpu</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00357">cube.c:357</a></div></div>
<div class="ttc" id="structdemo_html_aeaefe54fec088df4f5a3080be682cf77"><div class="ttname"><a href="structdemo.html#aeaefe54fec088df4f5a3080be682cf77">demo::fpGetRefreshCycleDurationGOOGLE</a></div><div class="ttdeci">PFN_vkGetRefreshCycleDurationGOOGLE fpGetRefreshCycleDurationGOOGLE</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00388">cube.c:388</a></div></div>
<div class="ttc" id="cube_8c_html_a28fe14fddb8a99da1b8a644308d1a901"><div class="ttname"><a href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a></div><div class="ttdeci">#define ERR_EXIT(err_msg, err_class)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00123">cube.c:123</a></div></div>
<div class="ttc" id="structdemo_html_ac403bc84bcb217a85f81ed0168f35b24"><div class="ttname"><a href="structdemo.html#ac403bc84bcb217a85f81ed0168f35b24">demo::fpGetPhysicalDeviceSurfacePresentModesKHR</a></div><div class="ttdeci">PFN_vkGetPhysicalDeviceSurfacePresentModesKHR fpGetPhysicalDeviceSurfacePresentModesKHR</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00382">cube.c:382</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a0c4cc92dc1a3456d6cca76e3187f2010_icgraph.png" border="0" usemap="#cube_8c_a0c4cc92dc1a3456d6cca76e3187f2010_icgraph" alt=""/></div>
<map name="cube_8c_a0c4cc92dc1a3456d6cca76e3187f2010_icgraph" id="cube_8c_a0c4cc92dc1a3456d6cca76e3187f2010_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="203,43,307,69"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="355,93,451,120"/>
<area shape="rect" id="node8" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1457,119,1531,145"/>
<area shape="rect" id="node4" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="499,93,625,120"/>
<area shape="rect" id="node6" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="876,119,964,145"/>
<area shape="rect" id="node7" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1263,119,1409,145"/>
<area shape="rect" id="node10" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1139,245,1215,272"/>
<area shape="rect" id="node5" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="673,93,828,120"/>
<area shape="rect" id="node9" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1012,156,1091,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a21da8dc23d75bc75b5dbe7dd01130739"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void demo_prepare_cube_data_buffers </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l01680">1680</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00180">vktexcube_vs_uniform::attr</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00231">g_uv_buffer_data</a>, <a class="el" href="cube_8c_source.html#l00187">g_vertex_buffer_data</a>, <a class="el" href="cube_8c_source.html#l00166">texture_object::mem_alloc</a>, <a class="el" href="cube_8c_source.html#l00598">memory_type_from_properties()</a>, <a class="el" href="cube_8c_source.html#l00421">demo::model_matrix</a>, <a class="el" href="cube_8c_source.html#l00178">vktexcube_vs_uniform::mvp</a>, <a class="el" href="cube_8c_source.html#l00179">vktexcube_vs_uniform::position</a>, <a class="el" href="cube_8c_source.html#l00419">demo::projection_matrix</a>, <a class="el" href="cube_8c_source.html#l00392">demo::swapchain_image_resources</a>, <a class="el" href="cube_8c_source.html#l00390">demo::swapchainImageCount</a>, <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>, <a class="el" href="cube_8c_source.html#l00299">SwapchainImageResources::uniform_buffer</a>, <a class="el" href="cube_8c_source.html#l00300">SwapchainImageResources::uniform_memory</a>, and <a class="el" href="cube_8c_source.html#l00420">demo::view_matrix</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>.</p>
<div class="fragment"><div class="line"><a name="l01680"></a><span class="lineno"> 1680</span>&#160;                                                       {</div><div class="line"><a name="l01681"></a><span class="lineno"> 1681</span>&#160;    VkBufferCreateInfo buf_info;</div><div class="line"><a name="l01682"></a><span class="lineno"> 1682</span>&#160;    VkMemoryRequirements mem_reqs;</div><div class="line"><a name="l01683"></a><span class="lineno"> 1683</span>&#160;    VkMemoryAllocateInfo mem_alloc;</div><div class="line"><a name="l01684"></a><span class="lineno"> 1684</span>&#160;    uint8_t *pData;</div><div class="line"><a name="l01685"></a><span class="lineno"> 1685</span>&#160;    mat4x4 MVP, VP;</div><div class="line"><a name="l01686"></a><span class="lineno"> 1686</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l01687"></a><span class="lineno"> 1687</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> pass;</div><div class="line"><a name="l01688"></a><span class="lineno"> 1688</span>&#160;    <span class="keyword">struct </span><a class="code" href="structvktexcube__vs__uniform.html">vktexcube_vs_uniform</a> data;</div><div class="line"><a name="l01689"></a><span class="lineno"> 1689</span>&#160;</div><div class="line"><a name="l01690"></a><span class="lineno"> 1690</span>&#160;    mat4x4_mul(VP, demo-&gt;<a class="code" href="structdemo.html#aaedd749233b7ac4c3995f57ed2661760">projection_matrix</a>, demo-&gt;<a class="code" href="structdemo.html#a48dbc591ffcf6b9ee0d8da7601221b46">view_matrix</a>);</div><div class="line"><a name="l01691"></a><span class="lineno"> 1691</span>&#160;    mat4x4_mul(MVP, VP, demo-&gt;<a class="code" href="structdemo.html#ae7f8cd202364dbe492a9bdb47e52c6d6">model_matrix</a>);</div><div class="line"><a name="l01692"></a><span class="lineno"> 1692</span>&#160;    memcpy(data.mvp, MVP, <span class="keyword">sizeof</span>(MVP));</div><div class="line"><a name="l01693"></a><span class="lineno"> 1693</span>&#160;    <span class="comment">//    dumpMatrix(&quot;MVP&quot;, MVP);</span></div><div class="line"><a name="l01694"></a><span class="lineno"> 1694</span>&#160;</div><div class="line"><a name="l01695"></a><span class="lineno"> 1695</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; 12 * 3; i++) {</div><div class="line"><a name="l01696"></a><span class="lineno"> 1696</span>&#160;        data.position[i][0] = <a class="code" href="cube_8c.html#adee35d5feec2cc176806a5fa7f468648">g_vertex_buffer_data</a>[i * 3];</div><div class="line"><a name="l01697"></a><span class="lineno"> 1697</span>&#160;        data.position[i][1] = <a class="code" href="cube_8c.html#adee35d5feec2cc176806a5fa7f468648">g_vertex_buffer_data</a>[i * 3 + 1];</div><div class="line"><a name="l01698"></a><span class="lineno"> 1698</span>&#160;        data.position[i][2] = <a class="code" href="cube_8c.html#adee35d5feec2cc176806a5fa7f468648">g_vertex_buffer_data</a>[i * 3 + 2];</div><div class="line"><a name="l01699"></a><span class="lineno"> 1699</span>&#160;        data.position[i][3] = 1.0f;</div><div class="line"><a name="l01700"></a><span class="lineno"> 1700</span>&#160;        data.attr[i][0] = <a class="code" href="cube_8c.html#ac130934c0214edabeb9870bcd94eca8c">g_uv_buffer_data</a>[2 * i];</div><div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>&#160;        data.attr[i][1] = <a class="code" href="cube_8c.html#ac130934c0214edabeb9870bcd94eca8c">g_uv_buffer_data</a>[2 * i + 1];</div><div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>&#160;        data.attr[i][2] = 0;</div><div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>&#160;        data.attr[i][3] = 0;</div><div class="line"><a name="l01704"></a><span class="lineno"> 1704</span>&#160;    }</div><div class="line"><a name="l01705"></a><span class="lineno"> 1705</span>&#160;</div><div class="line"><a name="l01706"></a><span class="lineno"> 1706</span>&#160;    memset(&amp;buf_info, 0, <span class="keyword">sizeof</span>(buf_info));</div><div class="line"><a name="l01707"></a><span class="lineno"> 1707</span>&#160;    buf_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;</div><div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>&#160;    buf_info.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;</div><div class="line"><a name="l01709"></a><span class="lineno"> 1709</span>&#160;    buf_info.size = <span class="keyword">sizeof</span>(data);</div><div class="line"><a name="l01710"></a><span class="lineno"> 1710</span>&#160;</div><div class="line"><a name="l01711"></a><span class="lineno"> 1711</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>; i++) {</div><div class="line"><a name="l01712"></a><span class="lineno"> 1712</span>&#160;        err = vkCreateBuffer(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;buf_info, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a73375235ed97731ad09a1400d9a50d63">uniform_buffer</a>);</div><div class="line"><a name="l01713"></a><span class="lineno"> 1713</span>&#160;        assert(!err);</div><div class="line"><a name="l01714"></a><span class="lineno"> 1714</span>&#160;</div><div class="line"><a name="l01715"></a><span class="lineno"> 1715</span>&#160;        vkGetBufferMemoryRequirements(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a73375235ed97731ad09a1400d9a50d63">uniform_buffer</a>, &amp;mem_reqs);</div><div class="line"><a name="l01716"></a><span class="lineno"> 1716</span>&#160;</div><div class="line"><a name="l01717"></a><span class="lineno"> 1717</span>&#160;        mem_alloc.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;</div><div class="line"><a name="l01718"></a><span class="lineno"> 1718</span>&#160;        mem_alloc.pNext = NULL;</div><div class="line"><a name="l01719"></a><span class="lineno"> 1719</span>&#160;        mem_alloc.allocationSize = mem_reqs.size;</div><div class="line"><a name="l01720"></a><span class="lineno"> 1720</span>&#160;        mem_alloc.memoryTypeIndex = 0;</div><div class="line"><a name="l01721"></a><span class="lineno"> 1721</span>&#160;</div><div class="line"><a name="l01722"></a><span class="lineno"> 1722</span>&#160;        pass = <a class="code" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b">memory_type_from_properties</a>(demo, mem_reqs.memoryTypeBits,</div><div class="line"><a name="l01723"></a><span class="lineno"> 1723</span>&#160;                                           VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,</div><div class="line"><a name="l01724"></a><span class="lineno"> 1724</span>&#160;                                           &amp;mem_alloc.memoryTypeIndex);</div><div class="line"><a name="l01725"></a><span class="lineno"> 1725</span>&#160;        assert(pass);</div><div class="line"><a name="l01726"></a><span class="lineno"> 1726</span>&#160;</div><div class="line"><a name="l01727"></a><span class="lineno"> 1727</span>&#160;        err = vkAllocateMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;mem_alloc, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a2e342d29ed730c31f00de806b8bfb4b2">uniform_memory</a>);</div><div class="line"><a name="l01728"></a><span class="lineno"> 1728</span>&#160;        assert(!err);</div><div class="line"><a name="l01729"></a><span class="lineno"> 1729</span>&#160;</div><div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>&#160;        err = vkMapMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a2e342d29ed730c31f00de806b8bfb4b2">uniform_memory</a>, 0, VK_WHOLE_SIZE, 0, (<span class="keywordtype">void</span> **)&amp;pData);</div><div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>&#160;        assert(!err);</div><div class="line"><a name="l01732"></a><span class="lineno"> 1732</span>&#160;</div><div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>&#160;        memcpy(pData, &amp;data, <span class="keyword">sizeof</span> data);</div><div class="line"><a name="l01734"></a><span class="lineno"> 1734</span>&#160;</div><div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>&#160;        vkUnmapMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a2e342d29ed730c31f00de806b8bfb4b2">uniform_memory</a>);</div><div class="line"><a name="l01736"></a><span class="lineno"> 1736</span>&#160;</div><div class="line"><a name="l01737"></a><span class="lineno"> 1737</span>&#160;        err = vkBindBufferMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a73375235ed97731ad09a1400d9a50d63">uniform_buffer</a>,</div><div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>&#160;                                 demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a2e342d29ed730c31f00de806b8bfb4b2">uniform_memory</a>, 0);</div><div class="line"><a name="l01739"></a><span class="lineno"> 1739</span>&#160;        assert(!err);</div><div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>&#160;    }</div><div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>&#160;}</div><div class="ttc" id="cube_8c_html_ac130934c0214edabeb9870bcd94eca8c"><div class="ttname"><a href="cube_8c.html#ac130934c0214edabeb9870bcd94eca8c">g_uv_buffer_data</a></div><div class="ttdeci">static const float g_uv_buffer_data[]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00231">cube.c:231</a></div></div>
<div class="ttc" id="structdemo_html_a337380c3a804d2cb24e6ce3a5ecc80e5"><div class="ttname"><a href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">demo::swapchainImageCount</a></div><div class="ttdeci">uint32_t swapchainImageCount</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00390">cube.c:390</a></div></div>
<div class="ttc" id="structdemo_html_a48dbc591ffcf6b9ee0d8da7601221b46"><div class="ttname"><a href="structdemo.html#a48dbc591ffcf6b9ee0d8da7601221b46">demo::view_matrix</a></div><div class="ttdeci">mat4x4 view_matrix</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00420">cube.c:420</a></div></div>
<div class="ttc" id="structdemo_html_a139cab94cb0a578562759d7f315ca0b5"><div class="ttname"><a href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">demo::swapchain_image_resources</a></div><div class="ttdeci">SwapchainImageResources * swapchain_image_resources</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00392">cube.c:392</a></div></div>
<div class="ttc" id="cube_8c_html_adee35d5feec2cc176806a5fa7f468648"><div class="ttname"><a href="cube_8c.html#adee35d5feec2cc176806a5fa7f468648">g_vertex_buffer_data</a></div><div class="ttdeci">static const float g_vertex_buffer_data[]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00187">cube.c:187</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a2e342d29ed730c31f00de806b8bfb4b2"><div class="ttname"><a href="struct_swapchain_image_resources.html#a2e342d29ed730c31f00de806b8bfb4b2">SwapchainImageResources::uniform_memory</a></div><div class="ttdeci">VkDeviceMemory uniform_memory</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00300">cube.c:300</a></div></div>
<div class="ttc" id="structdemo_html_aaedd749233b7ac4c3995f57ed2661760"><div class="ttname"><a href="structdemo.html#aaedd749233b7ac4c3995f57ed2661760">demo::projection_matrix</a></div><div class="ttdeci">mat4x4 projection_matrix</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00419">cube.c:419</a></div></div>
<div class="ttc" id="cube_8c_html_aff6bdb11d121e68bf2e3eecc2945ca3b"><div class="ttname"><a href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b">memory_type_from_properties</a></div><div class="ttdeci">static bool memory_type_from_properties(struct demo *demo, uint32_t typeBits, VkFlags requirements_mask, uint32_t *typeIndex)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00598">cube.c:598</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structvktexcube__vs__uniform_html"><div class="ttname"><a href="structvktexcube__vs__uniform.html">vktexcube_vs_uniform</a></div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00176">cube.c:176</a></div></div>
<div class="ttc" id="structdemo_html_ae7f8cd202364dbe492a9bdb47e52c6d6"><div class="ttname"><a href="structdemo.html#ae7f8cd202364dbe492a9bdb47e52c6d6">demo::model_matrix</a></div><div class="ttdeci">mat4x4 model_matrix</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00421">cube.c:421</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a73375235ed97731ad09a1400d9a50d63"><div class="ttname"><a href="struct_swapchain_image_resources.html#a73375235ed97731ad09a1400d9a50d63">SwapchainImageResources::uniform_buffer</a></div><div class="ttdeci">VkBuffer uniform_buffer</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00299">cube.c:299</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a21da8dc23d75bc75b5dbe7dd01130739_cgraph.png" border="0" usemap="#cube_8c_a21da8dc23d75bc75b5dbe7dd01130739_cgraph" alt=""/></div>
<map name="cube_8c_a21da8dc23d75bc75b5dbe7dd01130739_cgraph" id="cube_8c_a21da8dc23d75bc75b5dbe7dd01130739_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b" title="memory_type_from_properties" alt="" coords="224,13,421,39"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a21da8dc23d75bc75b5dbe7dd01130739_icgraph.png" border="0" usemap="#cube_8c_a21da8dc23d75bc75b5dbe7dd01130739_icgraph" alt=""/></div>
<map name="cube_8c_a21da8dc23d75bc75b5dbe7dd01130739_icgraph" id="cube_8c_a21da8dc23d75bc75b5dbe7dd01130739_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="224,43,328,69"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="376,93,472,120"/>
<area shape="rect" id="node8" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1479,119,1552,145"/>
<area shape="rect" id="node4" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="520,93,647,120"/>
<area shape="rect" id="node6" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="897,119,985,145"/>
<area shape="rect" id="node7" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1284,119,1431,145"/>
<area shape="rect" id="node10" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1160,245,1236,272"/>
<area shape="rect" id="node5" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="695,93,849,120"/>
<area shape="rect" id="node9" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1033,156,1112,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a3569c83afeb4ecc4d8d797af29ce89ed"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_prepare_depth </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l01393">1393</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">demo::depth</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00376">demo::format</a>, <a class="el" href="cube_8c_source.html#l00375">demo::height</a>, <a class="el" href="cube_8c_source.html#l00163">texture_object::image</a>, <a class="el" href="cube_8c_source.html#l00403">demo::image</a>, <a class="el" href="cube_8c_source.html#l00405">demo::mem</a>, <a class="el" href="cube_8c_source.html#l00404">demo::mem_alloc</a>, <a class="el" href="cube_8c_source.html#l00598">memory_type_from_properties()</a>, <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>, <a class="el" href="cube_8c_source.html#l00168">texture_object::view</a>, <a class="el" href="cube_8c_source.html#l00406">demo::view</a>, and <a class="el" href="cube_8c_source.html#l00375">demo::width</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>.</p>
<div class="fragment"><div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>&#160;                                                  {</div><div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>&#160;    <span class="keyword">const</span> VkFormat depth_format = VK_FORMAT_D16_UNORM;</div><div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>&#160;    <span class="keyword">const</span> VkImageCreateInfo image = {</div><div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>&#160;        .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,</div><div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>&#160;        .imageType = VK_IMAGE_TYPE_2D,</div><div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>&#160;        .format = depth_format,</div><div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>&#160;        .extent = {demo-&gt;<a class="code" href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">width</a>, demo-&gt;<a class="code" href="structdemo.html#a471d07293ae638531f808771c9975c07">height</a>, 1},</div><div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>&#160;        .mipLevels = 1,</div><div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>&#160;        .arrayLayers = 1,</div><div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>&#160;        .samples = VK_SAMPLE_COUNT_1_BIT,</div><div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>&#160;        .tiling = VK_IMAGE_TILING_OPTIMAL,</div><div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>&#160;        .usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,</div><div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>&#160;        .flags = 0,</div><div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>&#160;    };</div><div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>&#160;</div><div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>&#160;    VkImageViewCreateInfo view = {</div><div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>&#160;        .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,</div><div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>&#160;        .image = VK_NULL_HANDLE,</div><div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>&#160;        .format = depth_format,</div><div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>&#160;        .subresourceRange =</div><div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>&#160;            {.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT, .baseMipLevel = 0, .levelCount = 1, .baseArrayLayer = 0, .layerCount = 1},</div><div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>&#160;        .flags = 0,</div><div class="line"><a name="l01417"></a><span class="lineno"> 1417</span>&#160;        .viewType = VK_IMAGE_VIEW_TYPE_2D,</div><div class="line"><a name="l01418"></a><span class="lineno"> 1418</span>&#160;    };</div><div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>&#160;</div><div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>&#160;    VkMemoryRequirements mem_reqs;</div><div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> pass;</div><div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>&#160;</div><div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a8d379997ae0b03bfedacc9ca8145dd71">format</a> = depth_format;</div><div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>&#160;</div><div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>&#160;    <span class="comment">/* create image */</span></div><div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>&#160;    err = vkCreateImage(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;image, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a7b314d782d35c91b31bd7e810f42d2d3">image</a>);</div><div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>&#160;    assert(!err);</div><div class="line"><a name="l01429"></a><span class="lineno"> 1429</span>&#160;</div><div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>&#160;    vkGetImageMemoryRequirements(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a7b314d782d35c91b31bd7e810f42d2d3">image</a>, &amp;mem_reqs);</div><div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>&#160;    assert(!err);</div><div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>&#160;</div><div class="line"><a name="l01433"></a><span class="lineno"> 1433</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#af97c2a272a2a8178ff6e9ea00309aa3a">mem_alloc</a>.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;</div><div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#af97c2a272a2a8178ff6e9ea00309aa3a">mem_alloc</a>.pNext = NULL;</div><div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#af97c2a272a2a8178ff6e9ea00309aa3a">mem_alloc</a>.allocationSize = mem_reqs.size;</div><div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#af97c2a272a2a8178ff6e9ea00309aa3a">mem_alloc</a>.memoryTypeIndex = 0;</div><div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>&#160;</div><div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>&#160;    pass = <a class="code" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b">memory_type_from_properties</a>(demo, mem_reqs.memoryTypeBits, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,</div><div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>&#160;                                       &amp;demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#af97c2a272a2a8178ff6e9ea00309aa3a">mem_alloc</a>.memoryTypeIndex);</div><div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>&#160;    assert(pass);</div><div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>&#160;</div><div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>&#160;    <span class="comment">/* allocate memory */</span></div><div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>&#160;    err = vkAllocateMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#af97c2a272a2a8178ff6e9ea00309aa3a">mem_alloc</a>, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a506c89485b5987ac326e4616e20d38d1">mem</a>);</div><div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>&#160;    assert(!err);</div><div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>&#160;</div><div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>&#160;    <span class="comment">/* bind memory */</span></div><div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>&#160;    err = vkBindImageMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a7b314d782d35c91b31bd7e810f42d2d3">image</a>, demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a506c89485b5987ac326e4616e20d38d1">mem</a>, 0);</div><div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>&#160;    assert(!err);</div><div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>&#160;</div><div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>&#160;    <span class="comment">/* create image view */</span></div><div class="line"><a name="l01451"></a><span class="lineno"> 1451</span>&#160;    view.image = demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a7b314d782d35c91b31bd7e810f42d2d3">image</a>;</div><div class="line"><a name="l01452"></a><span class="lineno"> 1452</span>&#160;    err = vkCreateImageView(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;view, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a2acac138a169a49cb7ecb1e066249079">view</a>);</div><div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>&#160;    assert(!err);</div><div class="line"><a name="l01454"></a><span class="lineno"> 1454</span>&#160;}</div><div class="ttc" id="structdemo_html_a506c89485b5987ac326e4616e20d38d1"><div class="ttname"><a href="structdemo.html#a506c89485b5987ac326e4616e20d38d1">demo::mem</a></div><div class="ttdeci">VkDeviceMemory mem</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00405">cube.c:405</a></div></div>
<div class="ttc" id="structdemo_html_a471d07293ae638531f808771c9975c07"><div class="ttname"><a href="structdemo.html#a471d07293ae638531f808771c9975c07">demo::height</a></div><div class="ttdeci">int height</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="structdemo_html_a872713baccf01389616f3bf7c2358ea0"><div class="ttname"><a href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">demo::depth</a></div><div class="ttdeci">struct demo::@0 depth</div></div>
<div class="ttc" id="cube_8c_html_aff6bdb11d121e68bf2e3eecc2945ca3b"><div class="ttname"><a href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b">memory_type_from_properties</a></div><div class="ttdeci">static bool memory_type_from_properties(struct demo *demo, uint32_t typeBits, VkFlags requirements_mask, uint32_t *typeIndex)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00598">cube.c:598</a></div></div>
<div class="ttc" id="structdemo_html_af97c2a272a2a8178ff6e9ea00309aa3a"><div class="ttname"><a href="structdemo.html#af97c2a272a2a8178ff6e9ea00309aa3a">demo::mem_alloc</a></div><div class="ttdeci">VkMemoryAllocateInfo mem_alloc</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00404">cube.c:404</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_a2acac138a169a49cb7ecb1e066249079"><div class="ttname"><a href="structdemo.html#a2acac138a169a49cb7ecb1e066249079">demo::view</a></div><div class="ttdeci">VkImageView view</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00406">cube.c:406</a></div></div>
<div class="ttc" id="structdemo_html_a79020e20ddd6a4fe9bc9489a12d05696"><div class="ttname"><a href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">demo::width</a></div><div class="ttdeci">int width</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="structdemo_html_a8d379997ae0b03bfedacc9ca8145dd71"><div class="ttname"><a href="structdemo.html#a8d379997ae0b03bfedacc9ca8145dd71">demo::format</a></div><div class="ttdeci">VkFormat format</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00376">cube.c:376</a></div></div>
<div class="ttc" id="structdemo_html_a7b314d782d35c91b31bd7e810f42d2d3"><div class="ttname"><a href="structdemo.html#a7b314d782d35c91b31bd7e810f42d2d3">demo::image</a></div><div class="ttdeci">VkImage image</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00403">cube.c:403</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a3569c83afeb4ecc4d8d797af29ce89ed_cgraph.png" border="0" usemap="#cube_8c_a3569c83afeb4ecc4d8d797af29ce89ed_cgraph" alt=""/></div>
<map name="cube_8c_a3569c83afeb4ecc4d8d797af29ce89ed_cgraph" id="cube_8c_a3569c83afeb4ecc4d8d797af29ce89ed_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b" title="memory_type_from_properties" alt="" coords="196,5,393,32"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a3569c83afeb4ecc4d8d797af29ce89ed_icgraph.png" border="0" usemap="#cube_8c_a3569c83afeb4ecc4d8d797af29ce89ed_icgraph" alt=""/></div>
<map name="cube_8c_a3569c83afeb4ecc4d8d797af29ce89ed_icgraph" id="cube_8c_a3569c83afeb4ecc4d8d797af29ce89ed_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="196,43,300,69"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="348,93,444,120"/>
<area shape="rect" id="node8" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1451,119,1524,145"/>
<area shape="rect" id="node4" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="492,93,619,120"/>
<area shape="rect" id="node6" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="869,119,957,145"/>
<area shape="rect" id="node7" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1256,119,1403,145"/>
<area shape="rect" id="node10" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1132,245,1208,272"/>
<area shape="rect" id="node5" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="667,93,821,120"/>
<area shape="rect" id="node9" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1005,156,1084,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a36308c10e305d94d63e96fc82be78950"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_prepare_descriptor_layout </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l01743">1743</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00066">DEMO_TEXTURE_COUNT</a>, <a class="el" href="cube_8c_source.html#l00414">demo::desc_layout</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00413">demo::pipeline_layout</a>, and <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>.</p>
<div class="fragment"><div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>&#160;                                                              {</div><div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>&#160;    <span class="keyword">const</span> VkDescriptorSetLayoutBinding layout_bindings[2] = {</div><div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>&#160;        [0] =</div><div class="line"><a name="l01746"></a><span class="lineno"> 1746</span>&#160;            {</div><div class="line"><a name="l01747"></a><span class="lineno"> 1747</span>&#160;                .binding = 0,</div><div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>&#160;                .descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,</div><div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>&#160;                .descriptorCount = 1,</div><div class="line"><a name="l01750"></a><span class="lineno"> 1750</span>&#160;                .stageFlags = VK_SHADER_STAGE_VERTEX_BIT,</div><div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>&#160;                .pImmutableSamplers = NULL,</div><div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>&#160;            },</div><div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>&#160;        [1] =</div><div class="line"><a name="l01754"></a><span class="lineno"> 1754</span>&#160;            {</div><div class="line"><a name="l01755"></a><span class="lineno"> 1755</span>&#160;                .binding = 1,</div><div class="line"><a name="l01756"></a><span class="lineno"> 1756</span>&#160;                .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,</div><div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>&#160;                .descriptorCount = <a class="code" href="cube_8c.html#a889c754b96e13c9a94c431b8c10b7153">DEMO_TEXTURE_COUNT</a>,</div><div class="line"><a name="l01758"></a><span class="lineno"> 1758</span>&#160;                .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT,</div><div class="line"><a name="l01759"></a><span class="lineno"> 1759</span>&#160;                .pImmutableSamplers = NULL,</div><div class="line"><a name="l01760"></a><span class="lineno"> 1760</span>&#160;            },</div><div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>&#160;    };</div><div class="line"><a name="l01762"></a><span class="lineno"> 1762</span>&#160;    <span class="keyword">const</span> VkDescriptorSetLayoutCreateInfo descriptor_layout = {</div><div class="line"><a name="l01763"></a><span class="lineno"> 1763</span>&#160;        .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,</div><div class="line"><a name="l01764"></a><span class="lineno"> 1764</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l01765"></a><span class="lineno"> 1765</span>&#160;        .bindingCount = 2,</div><div class="line"><a name="l01766"></a><span class="lineno"> 1766</span>&#160;        .pBindings = layout_bindings,</div><div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>&#160;    };</div><div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l01769"></a><span class="lineno"> 1769</span>&#160;</div><div class="line"><a name="l01770"></a><span class="lineno"> 1770</span>&#160;    err = vkCreateDescriptorSetLayout(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;descriptor_layout, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a2bdc8b6c1791c08c4b6ad61873b30155">desc_layout</a>);</div><div class="line"><a name="l01771"></a><span class="lineno"> 1771</span>&#160;    assert(!err);</div><div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>&#160;</div><div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>&#160;    <span class="keyword">const</span> VkPipelineLayoutCreateInfo pPipelineLayoutCreateInfo = {</div><div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>&#160;        .sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,</div><div class="line"><a name="l01775"></a><span class="lineno"> 1775</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l01776"></a><span class="lineno"> 1776</span>&#160;        .setLayoutCount = 1,</div><div class="line"><a name="l01777"></a><span class="lineno"> 1777</span>&#160;        .pSetLayouts = &amp;demo-&gt;<a class="code" href="structdemo.html#a2bdc8b6c1791c08c4b6ad61873b30155">desc_layout</a>,</div><div class="line"><a name="l01778"></a><span class="lineno"> 1778</span>&#160;    };</div><div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>&#160;</div><div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>&#160;    err = vkCreatePipelineLayout(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;pPipelineLayoutCreateInfo, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a1f9db6e3c3b5edf52eda4d2d95ad9a42">pipeline_layout</a>);</div><div class="line"><a name="l01781"></a><span class="lineno"> 1781</span>&#160;    assert(!err);</div><div class="line"><a name="l01782"></a><span class="lineno"> 1782</span>&#160;}</div><div class="ttc" id="cube_8c_html_a889c754b96e13c9a94c431b8c10b7153"><div class="ttname"><a href="cube_8c.html#a889c754b96e13c9a94c431b8c10b7153">DEMO_TEXTURE_COUNT</a></div><div class="ttdeci">#define DEMO_TEXTURE_COUNT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00066">cube.c:66</a></div></div>
<div class="ttc" id="structdemo_html_a2bdc8b6c1791c08c4b6ad61873b30155"><div class="ttname"><a href="structdemo.html#a2bdc8b6c1791c08c4b6ad61873b30155">demo::desc_layout</a></div><div class="ttdeci">VkDescriptorSetLayout desc_layout</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00414">cube.c:414</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_a1f9db6e3c3b5edf52eda4d2d95ad9a42"><div class="ttname"><a href="structdemo.html#a1f9db6e3c3b5edf52eda4d2d95ad9a42">demo::pipeline_layout</a></div><div class="ttdeci">VkPipelineLayout pipeline_layout</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00413">cube.c:413</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a36308c10e305d94d63e96fc82be78950_icgraph.png" border="0" usemap="#cube_8c_a36308c10e305d94d63e96fc82be78950_icgraph" alt=""/></div>
<map name="cube_8c_a36308c10e305d94d63e96fc82be78950_icgraph" id="cube_8c_a36308c10e305d94d63e96fc82be78950_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="221,43,325,69"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="373,93,469,120"/>
<area shape="rect" id="node8" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1476,119,1549,145"/>
<area shape="rect" id="node4" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="517,93,644,120"/>
<area shape="rect" id="node6" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="895,119,983,145"/>
<area shape="rect" id="node7" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1281,119,1428,145"/>
<area shape="rect" id="node10" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1157,245,1233,272"/>
<area shape="rect" id="node5" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="692,93,847,120"/>
<area shape="rect" id="node9" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1031,156,1109,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a4ee7f5efc65c5972db015c6be8cda380"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_prepare_descriptor_pool </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l02004">2004</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00066">DEMO_TEXTURE_COUNT</a>, <a class="el" href="cube_8c_source.html#l00430">demo::desc_pool</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00390">demo::swapchainImageCount</a>, and <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>.</p>
<div class="fragment"><div class="line"><a name="l02004"></a><span class="lineno"> 2004</span>&#160;                                                            {</div><div class="line"><a name="l02005"></a><span class="lineno"> 2005</span>&#160;    <span class="keyword">const</span> VkDescriptorPoolSize type_counts[2] = {</div><div class="line"><a name="l02006"></a><span class="lineno"> 2006</span>&#160;        [0] =</div><div class="line"><a name="l02007"></a><span class="lineno"> 2007</span>&#160;            {</div><div class="line"><a name="l02008"></a><span class="lineno"> 2008</span>&#160;                .type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,</div><div class="line"><a name="l02009"></a><span class="lineno"> 2009</span>&#160;                .descriptorCount = demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>,</div><div class="line"><a name="l02010"></a><span class="lineno"> 2010</span>&#160;            },</div><div class="line"><a name="l02011"></a><span class="lineno"> 2011</span>&#160;        [1] =</div><div class="line"><a name="l02012"></a><span class="lineno"> 2012</span>&#160;            {</div><div class="line"><a name="l02013"></a><span class="lineno"> 2013</span>&#160;                .type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,</div><div class="line"><a name="l02014"></a><span class="lineno"> 2014</span>&#160;                .descriptorCount = demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a> * <a class="code" href="cube_8c.html#a889c754b96e13c9a94c431b8c10b7153">DEMO_TEXTURE_COUNT</a>,</div><div class="line"><a name="l02015"></a><span class="lineno"> 2015</span>&#160;            },</div><div class="line"><a name="l02016"></a><span class="lineno"> 2016</span>&#160;    };</div><div class="line"><a name="l02017"></a><span class="lineno"> 2017</span>&#160;    <span class="keyword">const</span> VkDescriptorPoolCreateInfo descriptor_pool = {</div><div class="line"><a name="l02018"></a><span class="lineno"> 2018</span>&#160;        .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,</div><div class="line"><a name="l02019"></a><span class="lineno"> 2019</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l02020"></a><span class="lineno"> 2020</span>&#160;        .maxSets = demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>,</div><div class="line"><a name="l02021"></a><span class="lineno"> 2021</span>&#160;        .poolSizeCount = 2,</div><div class="line"><a name="l02022"></a><span class="lineno"> 2022</span>&#160;        .pPoolSizes = type_counts,</div><div class="line"><a name="l02023"></a><span class="lineno"> 2023</span>&#160;    };</div><div class="line"><a name="l02024"></a><span class="lineno"> 2024</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l02025"></a><span class="lineno"> 2025</span>&#160;</div><div class="line"><a name="l02026"></a><span class="lineno"> 2026</span>&#160;    err = vkCreateDescriptorPool(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;descriptor_pool, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a20263af0f46296860c8053ee113fa9f8">desc_pool</a>);</div><div class="line"><a name="l02027"></a><span class="lineno"> 2027</span>&#160;    assert(!err);</div><div class="line"><a name="l02028"></a><span class="lineno"> 2028</span>&#160;}</div><div class="ttc" id="structdemo_html_a337380c3a804d2cb24e6ce3a5ecc80e5"><div class="ttname"><a href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">demo::swapchainImageCount</a></div><div class="ttdeci">uint32_t swapchainImageCount</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00390">cube.c:390</a></div></div>
<div class="ttc" id="cube_8c_html_a889c754b96e13c9a94c431b8c10b7153"><div class="ttname"><a href="cube_8c.html#a889c754b96e13c9a94c431b8c10b7153">DEMO_TEXTURE_COUNT</a></div><div class="ttdeci">#define DEMO_TEXTURE_COUNT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00066">cube.c:66</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_a20263af0f46296860c8053ee113fa9f8"><div class="ttname"><a href="structdemo.html#a20263af0f46296860c8053ee113fa9f8">demo::desc_pool</a></div><div class="ttdeci">VkDescriptorPool desc_pool</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00430">cube.c:430</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a4ee7f5efc65c5972db015c6be8cda380_icgraph.png" border="0" usemap="#cube_8c_a4ee7f5efc65c5972db015c6be8cda380_icgraph" alt=""/></div>
<map name="cube_8c_a4ee7f5efc65c5972db015c6be8cda380_icgraph" id="cube_8c_a4ee7f5efc65c5972db015c6be8cda380_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="252,43,356,69"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="404,93,500,120"/>
<area shape="rect" id="node8" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1507,119,1580,145"/>
<area shape="rect" id="node4" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="548,93,675,120"/>
<area shape="rect" id="node6" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="925,119,1013,145"/>
<area shape="rect" id="node7" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1312,119,1459,145"/>
<area shape="rect" id="node10" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1188,245,1264,272"/>
<area shape="rect" id="node5" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="723,93,877,120"/>
<area shape="rect" id="node9" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1061,156,1140,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ac1957f225fabd1755a0064169fa5f6ba"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_prepare_descriptor_set </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l02030">2030</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00066">DEMO_TEXTURE_COUNT</a>, <a class="el" href="cube_8c_source.html#l00414">demo::desc_layout</a>, <a class="el" href="cube_8c_source.html#l00430">demo::desc_pool</a>, <a class="el" href="cube_8c_source.html#l00302">SwapchainImageResources::descriptor_set</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00161">texture_object::sampler</a>, <a class="el" href="cube_8c_source.html#l00392">demo::swapchain_image_resources</a>, <a class="el" href="cube_8c_source.html#l00390">demo::swapchainImageCount</a>, <a class="el" href="cube_8c_source.html#l00409">demo::textures</a>, <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>, <a class="el" href="cube_8c_source.html#l00299">SwapchainImageResources::uniform_buffer</a>, and <a class="el" href="cube_8c_source.html#l00168">texture_object::view</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>.</p>
<div class="fragment"><div class="line"><a name="l02030"></a><span class="lineno"> 2030</span>&#160;                                                           {</div><div class="line"><a name="l02031"></a><span class="lineno"> 2031</span>&#160;    VkDescriptorImageInfo tex_descs[<a class="code" href="cube_8c.html#a889c754b96e13c9a94c431b8c10b7153">DEMO_TEXTURE_COUNT</a>];</div><div class="line"><a name="l02032"></a><span class="lineno"> 2032</span>&#160;    VkWriteDescriptorSet writes[2];</div><div class="line"><a name="l02033"></a><span class="lineno"> 2033</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l02034"></a><span class="lineno"> 2034</span>&#160;</div><div class="line"><a name="l02035"></a><span class="lineno"> 2035</span>&#160;    VkDescriptorSetAllocateInfo alloc_info = {.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO,</div><div class="line"><a name="l02036"></a><span class="lineno"> 2036</span>&#160;                                              .pNext = NULL,</div><div class="line"><a name="l02037"></a><span class="lineno"> 2037</span>&#160;                                              .descriptorPool = demo-&gt;<a class="code" href="structdemo.html#a20263af0f46296860c8053ee113fa9f8">desc_pool</a>,</div><div class="line"><a name="l02038"></a><span class="lineno"> 2038</span>&#160;                                              .descriptorSetCount = 1,</div><div class="line"><a name="l02039"></a><span class="lineno"> 2039</span>&#160;                                              .pSetLayouts = &amp;demo-&gt;<a class="code" href="structdemo.html#a2bdc8b6c1791c08c4b6ad61873b30155">desc_layout</a>};</div><div class="line"><a name="l02040"></a><span class="lineno"> 2040</span>&#160;</div><div class="line"><a name="l02041"></a><span class="lineno"> 2041</span>&#160;    VkDescriptorBufferInfo buffer_info;</div><div class="line"><a name="l02042"></a><span class="lineno"> 2042</span>&#160;    buffer_info.offset = 0;</div><div class="line"><a name="l02043"></a><span class="lineno"> 2043</span>&#160;    buffer_info.range = <span class="keyword">sizeof</span>(<span class="keyword">struct </span><a class="code" href="structvktexcube__vs__uniform.html">vktexcube_vs_uniform</a>);</div><div class="line"><a name="l02044"></a><span class="lineno"> 2044</span>&#160;</div><div class="line"><a name="l02045"></a><span class="lineno"> 2045</span>&#160;    memset(&amp;tex_descs, 0, <span class="keyword">sizeof</span>(tex_descs));</div><div class="line"><a name="l02046"></a><span class="lineno"> 2046</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="cube_8c.html#a889c754b96e13c9a94c431b8c10b7153">DEMO_TEXTURE_COUNT</a>; i++) {</div><div class="line"><a name="l02047"></a><span class="lineno"> 2047</span>&#160;        tex_descs[i].sampler = demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#a3e54bffa65ec12e0bb5daa2dc4fb1efd">sampler</a>;</div><div class="line"><a name="l02048"></a><span class="lineno"> 2048</span>&#160;        tex_descs[i].imageView = demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#acf536a91cb2f8b06b4d4ea1b818c8eb1">view</a>;</div><div class="line"><a name="l02049"></a><span class="lineno"> 2049</span>&#160;        tex_descs[i].imageLayout = VK_IMAGE_LAYOUT_GENERAL;</div><div class="line"><a name="l02050"></a><span class="lineno"> 2050</span>&#160;    }</div><div class="line"><a name="l02051"></a><span class="lineno"> 2051</span>&#160;</div><div class="line"><a name="l02052"></a><span class="lineno"> 2052</span>&#160;    memset(&amp;writes, 0, <span class="keyword">sizeof</span>(writes));</div><div class="line"><a name="l02053"></a><span class="lineno"> 2053</span>&#160;</div><div class="line"><a name="l02054"></a><span class="lineno"> 2054</span>&#160;    writes[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;</div><div class="line"><a name="l02055"></a><span class="lineno"> 2055</span>&#160;    writes[0].descriptorCount = 1;</div><div class="line"><a name="l02056"></a><span class="lineno"> 2056</span>&#160;    writes[0].descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;</div><div class="line"><a name="l02057"></a><span class="lineno"> 2057</span>&#160;    writes[0].pBufferInfo = &amp;buffer_info;</div><div class="line"><a name="l02058"></a><span class="lineno"> 2058</span>&#160;</div><div class="line"><a name="l02059"></a><span class="lineno"> 2059</span>&#160;    writes[1].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;</div><div class="line"><a name="l02060"></a><span class="lineno"> 2060</span>&#160;    writes[1].dstBinding = 1;</div><div class="line"><a name="l02061"></a><span class="lineno"> 2061</span>&#160;    writes[1].descriptorCount = <a class="code" href="cube_8c.html#a889c754b96e13c9a94c431b8c10b7153">DEMO_TEXTURE_COUNT</a>;</div><div class="line"><a name="l02062"></a><span class="lineno"> 2062</span>&#160;    writes[1].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;</div><div class="line"><a name="l02063"></a><span class="lineno"> 2063</span>&#160;    writes[1].pImageInfo = tex_descs;</div><div class="line"><a name="l02064"></a><span class="lineno"> 2064</span>&#160;</div><div class="line"><a name="l02065"></a><span class="lineno"> 2065</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>; i++) {</div><div class="line"><a name="l02066"></a><span class="lineno"> 2066</span>&#160;        err = vkAllocateDescriptorSets(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;alloc_info, &amp;demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#af229c281b85faf95a6bda5aab7a7e348">descriptor_set</a>);</div><div class="line"><a name="l02067"></a><span class="lineno"> 2067</span>&#160;        assert(!err);</div><div class="line"><a name="l02068"></a><span class="lineno"> 2068</span>&#160;        buffer_info.buffer = demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a73375235ed97731ad09a1400d9a50d63">uniform_buffer</a>;</div><div class="line"><a name="l02069"></a><span class="lineno"> 2069</span>&#160;        writes[0].dstSet = demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#af229c281b85faf95a6bda5aab7a7e348">descriptor_set</a>;</div><div class="line"><a name="l02070"></a><span class="lineno"> 2070</span>&#160;        writes[1].dstSet = demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#af229c281b85faf95a6bda5aab7a7e348">descriptor_set</a>;</div><div class="line"><a name="l02071"></a><span class="lineno"> 2071</span>&#160;        vkUpdateDescriptorSets(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, 2, writes, 0, NULL);</div><div class="line"><a name="l02072"></a><span class="lineno"> 2072</span>&#160;    }</div><div class="line"><a name="l02073"></a><span class="lineno"> 2073</span>&#160;}</div><div class="ttc" id="structdemo_html_a337380c3a804d2cb24e6ce3a5ecc80e5"><div class="ttname"><a href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">demo::swapchainImageCount</a></div><div class="ttdeci">uint32_t swapchainImageCount</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00390">cube.c:390</a></div></div>
<div class="ttc" id="structtexture__object_html_a3e54bffa65ec12e0bb5daa2dc4fb1efd"><div class="ttname"><a href="structtexture__object.html#a3e54bffa65ec12e0bb5daa2dc4fb1efd">texture_object::sampler</a></div><div class="ttdeci">VkSampler sampler</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00161">cube.c:161</a></div></div>
<div class="ttc" id="cube_8c_html_a889c754b96e13c9a94c431b8c10b7153"><div class="ttname"><a href="cube_8c.html#a889c754b96e13c9a94c431b8c10b7153">DEMO_TEXTURE_COUNT</a></div><div class="ttdeci">#define DEMO_TEXTURE_COUNT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00066">cube.c:66</a></div></div>
<div class="ttc" id="structdemo_html_a139cab94cb0a578562759d7f315ca0b5"><div class="ttname"><a href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">demo::swapchain_image_resources</a></div><div class="ttdeci">SwapchainImageResources * swapchain_image_resources</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00392">cube.c:392</a></div></div>
<div class="ttc" id="structdemo_html_a2bdc8b6c1791c08c4b6ad61873b30155"><div class="ttname"><a href="structdemo.html#a2bdc8b6c1791c08c4b6ad61873b30155">demo::desc_layout</a></div><div class="ttdeci">VkDescriptorSetLayout desc_layout</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00414">cube.c:414</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_a20263af0f46296860c8053ee113fa9f8"><div class="ttname"><a href="structdemo.html#a20263af0f46296860c8053ee113fa9f8">demo::desc_pool</a></div><div class="ttdeci">VkDescriptorPool desc_pool</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00430">cube.c:430</a></div></div>
<div class="ttc" id="structdemo_html_a069de0b6f83a6c8af47b14dc76e52ee5"><div class="ttname"><a href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">demo::textures</a></div><div class="ttdeci">struct texture_object textures[DEMO_TEXTURE_COUNT]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00409">cube.c:409</a></div></div>
<div class="ttc" id="structtexture__object_html_acf536a91cb2f8b06b4d4ea1b818c8eb1"><div class="ttname"><a href="structtexture__object.html#acf536a91cb2f8b06b4d4ea1b818c8eb1">texture_object::view</a></div><div class="ttdeci">VkImageView view</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00168">cube.c:168</a></div></div>
<div class="ttc" id="structvktexcube__vs__uniform_html"><div class="ttname"><a href="structvktexcube__vs__uniform.html">vktexcube_vs_uniform</a></div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00176">cube.c:176</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_af229c281b85faf95a6bda5aab7a7e348"><div class="ttname"><a href="struct_swapchain_image_resources.html#af229c281b85faf95a6bda5aab7a7e348">SwapchainImageResources::descriptor_set</a></div><div class="ttdeci">VkDescriptorSet descriptor_set</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00302">cube.c:302</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a73375235ed97731ad09a1400d9a50d63"><div class="ttname"><a href="struct_swapchain_image_resources.html#a73375235ed97731ad09a1400d9a50d63">SwapchainImageResources::uniform_buffer</a></div><div class="ttdeci">VkBuffer uniform_buffer</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00299">cube.c:299</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ac1957f225fabd1755a0064169fa5f6ba_icgraph.png" border="0" usemap="#cube_8c_ac1957f225fabd1755a0064169fa5f6ba_icgraph" alt=""/></div>
<map name="cube_8c_ac1957f225fabd1755a0064169fa5f6ba_icgraph" id="cube_8c_ac1957f225fabd1755a0064169fa5f6ba_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="247,43,351,69"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="399,93,495,120"/>
<area shape="rect" id="node8" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1501,119,1575,145"/>
<area shape="rect" id="node4" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="543,93,669,120"/>
<area shape="rect" id="node6" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="920,119,1008,145"/>
<area shape="rect" id="node7" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1307,119,1453,145"/>
<area shape="rect" id="node10" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1183,245,1259,272"/>
<area shape="rect" id="node5" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="717,93,872,120"/>
<area shape="rect" id="node9" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1056,156,1135,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a3a72610dc44a370494307b568ef3abd6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_prepare_framebuffers </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l02075">2075</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">demo::depth</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00301">SwapchainImageResources::framebuffer</a>, <a class="el" href="cube_8c_source.html#l00375">demo::height</a>, <a class="el" href="cube_8c_source.html#l00416">demo::render_pass</a>, <a class="el" href="cube_8c_source.html#l00392">demo::swapchain_image_resources</a>, <a class="el" href="cube_8c_source.html#l00390">demo::swapchainImageCount</a>, <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>, <a class="el" href="cube_8c_source.html#l00298">SwapchainImageResources::view</a>, <a class="el" href="cube_8c_source.html#l00406">demo::view</a>, and <a class="el" href="cube_8c_source.html#l00375">demo::width</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>.</p>
<div class="fragment"><div class="line"><a name="l02075"></a><span class="lineno"> 2075</span>&#160;                                                         {</div><div class="line"><a name="l02076"></a><span class="lineno"> 2076</span>&#160;    VkImageView attachments[2];</div><div class="line"><a name="l02077"></a><span class="lineno"> 2077</span>&#160;    attachments[1] = demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a2acac138a169a49cb7ecb1e066249079">view</a>;</div><div class="line"><a name="l02078"></a><span class="lineno"> 2078</span>&#160;</div><div class="line"><a name="l02079"></a><span class="lineno"> 2079</span>&#160;    <span class="keyword">const</span> VkFramebufferCreateInfo fb_info = {</div><div class="line"><a name="l02080"></a><span class="lineno"> 2080</span>&#160;        .sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,</div><div class="line"><a name="l02081"></a><span class="lineno"> 2081</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l02082"></a><span class="lineno"> 2082</span>&#160;        .renderPass = demo-&gt;<a class="code" href="structdemo.html#a759be060753e7516d58c97f59af390ff">render_pass</a>,</div><div class="line"><a name="l02083"></a><span class="lineno"> 2083</span>&#160;        .attachmentCount = 2,</div><div class="line"><a name="l02084"></a><span class="lineno"> 2084</span>&#160;        .pAttachments = attachments,</div><div class="line"><a name="l02085"></a><span class="lineno"> 2085</span>&#160;        .width = demo-&gt;<a class="code" href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">width</a>,</div><div class="line"><a name="l02086"></a><span class="lineno"> 2086</span>&#160;        .height = demo-&gt;<a class="code" href="structdemo.html#a471d07293ae638531f808771c9975c07">height</a>,</div><div class="line"><a name="l02087"></a><span class="lineno"> 2087</span>&#160;        .layers = 1,</div><div class="line"><a name="l02088"></a><span class="lineno"> 2088</span>&#160;    };</div><div class="line"><a name="l02089"></a><span class="lineno"> 2089</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l02090"></a><span class="lineno"> 2090</span>&#160;    uint32_t i;</div><div class="line"><a name="l02091"></a><span class="lineno"> 2091</span>&#160;</div><div class="line"><a name="l02092"></a><span class="lineno"> 2092</span>&#160;    <span class="keywordflow">for</span> (i = 0; i &lt; demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>; i++) {</div><div class="line"><a name="l02093"></a><span class="lineno"> 2093</span>&#160;        attachments[0] = demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a2fc87148f25f154eaeaf7dc2cdef135d">view</a>;</div><div class="line"><a name="l02094"></a><span class="lineno"> 2094</span>&#160;        err = vkCreateFramebuffer(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;fb_info, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a09729b546f1f1017e0052fd076299776">framebuffer</a>);</div><div class="line"><a name="l02095"></a><span class="lineno"> 2095</span>&#160;        assert(!err);</div><div class="line"><a name="l02096"></a><span class="lineno"> 2096</span>&#160;    }</div><div class="line"><a name="l02097"></a><span class="lineno"> 2097</span>&#160;}</div><div class="ttc" id="structdemo_html_a337380c3a804d2cb24e6ce3a5ecc80e5"><div class="ttname"><a href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">demo::swapchainImageCount</a></div><div class="ttdeci">uint32_t swapchainImageCount</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00390">cube.c:390</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a2fc87148f25f154eaeaf7dc2cdef135d"><div class="ttname"><a href="struct_swapchain_image_resources.html#a2fc87148f25f154eaeaf7dc2cdef135d">SwapchainImageResources::view</a></div><div class="ttdeci">VkImageView view</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00298">cube.c:298</a></div></div>
<div class="ttc" id="structdemo_html_a471d07293ae638531f808771c9975c07"><div class="ttname"><a href="structdemo.html#a471d07293ae638531f808771c9975c07">demo::height</a></div><div class="ttdeci">int height</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="structdemo_html_a139cab94cb0a578562759d7f315ca0b5"><div class="ttname"><a href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">demo::swapchain_image_resources</a></div><div class="ttdeci">SwapchainImageResources * swapchain_image_resources</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00392">cube.c:392</a></div></div>
<div class="ttc" id="structdemo_html_a872713baccf01389616f3bf7c2358ea0"><div class="ttname"><a href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">demo::depth</a></div><div class="ttdeci">struct demo::@0 depth</div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a09729b546f1f1017e0052fd076299776"><div class="ttname"><a href="struct_swapchain_image_resources.html#a09729b546f1f1017e0052fd076299776">SwapchainImageResources::framebuffer</a></div><div class="ttdeci">VkFramebuffer framebuffer</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00301">cube.c:301</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_a2acac138a169a49cb7ecb1e066249079"><div class="ttname"><a href="structdemo.html#a2acac138a169a49cb7ecb1e066249079">demo::view</a></div><div class="ttdeci">VkImageView view</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00406">cube.c:406</a></div></div>
<div class="ttc" id="structdemo_html_a79020e20ddd6a4fe9bc9489a12d05696"><div class="ttname"><a href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">demo::width</a></div><div class="ttdeci">int width</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
<div class="ttc" id="structdemo_html_a759be060753e7516d58c97f59af390ff"><div class="ttname"><a href="structdemo.html#a759be060753e7516d58c97f59af390ff">demo::render_pass</a></div><div class="ttdeci">VkRenderPass render_pass</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00416">cube.c:416</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a3a72610dc44a370494307b568ef3abd6_icgraph.png" border="0" usemap="#cube_8c_a3a72610dc44a370494307b568ef3abd6_icgraph" alt=""/></div>
<map name="cube_8c_a3a72610dc44a370494307b568ef3abd6_icgraph" id="cube_8c_a3a72610dc44a370494307b568ef3abd6_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="235,43,339,69"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="387,93,483,120"/>
<area shape="rect" id="node8" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1489,119,1563,145"/>
<area shape="rect" id="node4" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="531,93,657,120"/>
<area shape="rect" id="node6" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="908,119,996,145"/>
<area shape="rect" id="node7" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1295,119,1441,145"/>
<area shape="rect" id="node10" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1171,245,1247,272"/>
<area shape="rect" id="node5" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="705,93,860,120"/>
<area shape="rect" id="node9" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1044,156,1123,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ab89d9436b88fd3dea5de8cb03de51e94"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_prepare_fs </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l01880">1880</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l01856">demo_prepare_shader_module()</a>, and <a class="el" href="cube_8c_source.html#l00428">demo::frag_shader_module</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l01887">demo_prepare_pipeline()</a>.</p>
<div class="fragment"><div class="line"><a name="l01880"></a><span class="lineno"> 1880</span>&#160;                                               {</div><div class="line"><a name="l01881"></a><span class="lineno"> 1881</span>&#160;    <span class="keyword">const</span> uint32_t fs_code[] = {</div><div class="line"><a name="l01882"></a><span class="lineno"> 1882</span>&#160;<span class="preprocessor">#include &quot;cube.frag.inc&quot;</span></div><div class="line"><a name="l01883"></a><span class="lineno"> 1883</span>&#160;    };</div><div class="line"><a name="l01884"></a><span class="lineno"> 1884</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a307ae140fd7635edef644e29226ad17b">frag_shader_module</a> = <a class="code" href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c">demo_prepare_shader_module</a>(demo, fs_code, <span class="keyword">sizeof</span>(fs_code));</div><div class="line"><a name="l01885"></a><span class="lineno"> 1885</span>&#160;}</div><div class="ttc" id="structdemo_html_a307ae140fd7635edef644e29226ad17b"><div class="ttname"><a href="structdemo.html#a307ae140fd7635edef644e29226ad17b">demo::frag_shader_module</a></div><div class="ttdeci">VkShaderModule frag_shader_module</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00428">cube.c:428</a></div></div>
<div class="ttc" id="cube_8c_html_a9d15bfd7acf51a14826bbfe1d52da09c"><div class="ttname"><a href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c">demo_prepare_shader_module</a></div><div class="ttdeci">static VkShaderModule demo_prepare_shader_module(struct demo *demo, const uint32_t *code, size_t size)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l01856">cube.c:1856</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ab89d9436b88fd3dea5de8cb03de51e94_cgraph.png" border="0" usemap="#cube_8c_ab89d9436b88fd3dea5de8cb03de51e94_cgraph" alt=""/></div>
<map name="cube_8c_ab89d9436b88fd3dea5de8cb03de51e94_cgraph" id="cube_8c_ab89d9436b88fd3dea5de8cb03de51e94_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c" title="demo_prepare_shader\l_module" alt="" coords="175,5,325,47"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ab89d9436b88fd3dea5de8cb03de51e94_icgraph.png" border="0" usemap="#cube_8c_ab89d9436b88fd3dea5de8cb03de51e94_icgraph" alt=""/></div>
<map name="cube_8c_ab89d9436b88fd3dea5de8cb03de51e94_icgraph" id="cube_8c_ab89d9436b88fd3dea5de8cb03de51e94_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#aa80cd8877b6b5d20217c451b207ca9d9" title="demo_prepare_pipeline" alt="" coords="175,43,329,69"/>
<area shape="rect" id="node3" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="377,43,481,69"/>
<area shape="rect" id="node4" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="529,93,625,120"/>
<area shape="rect" id="node9" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1632,119,1705,145"/>
<area shape="rect" id="node5" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="673,93,800,120"/>
<area shape="rect" id="node7" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="1051,119,1139,145"/>
<area shape="rect" id="node8" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1437,119,1584,145"/>
<area shape="rect" id="node11" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1313,245,1389,272"/>
<area shape="rect" id="node6" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="848,93,1003,120"/>
<area shape="rect" id="node10" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1187,156,1265,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="aa80cd8877b6b5d20217c451b207ca9d9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_prepare_pipeline </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l01887">1887</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00073">ARRAY_SIZE</a>, <a class="el" href="cube_8c_source.html#l01880">demo_prepare_fs()</a>, <a class="el" href="cube_8c_source.html#l01873">demo_prepare_vs()</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00428">demo::frag_shader_module</a>, <a class="el" href="cube_8c_source.html#l00417">demo::pipeline</a>, <a class="el" href="cube_8c_source.html#l00413">demo::pipeline_layout</a>, <a class="el" href="cube_8c_source.html#l00415">demo::pipelineCache</a>, <a class="el" href="cube_8c_source.html#l00416">demo::render_pass</a>, <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>, and <a class="el" href="cube_8c_source.html#l00427">demo::vert_shader_module</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>.</p>
<div class="fragment"><div class="line"><a name="l01887"></a><span class="lineno"> 1887</span>&#160;                                                     {</div><div class="line"><a name="l01888"></a><span class="lineno"> 1888</span>&#160;    VkGraphicsPipelineCreateInfo pipeline;</div><div class="line"><a name="l01889"></a><span class="lineno"> 1889</span>&#160;    VkPipelineCacheCreateInfo pipelineCache;</div><div class="line"><a name="l01890"></a><span class="lineno"> 1890</span>&#160;    VkPipelineVertexInputStateCreateInfo vi;</div><div class="line"><a name="l01891"></a><span class="lineno"> 1891</span>&#160;    VkPipelineInputAssemblyStateCreateInfo ia;</div><div class="line"><a name="l01892"></a><span class="lineno"> 1892</span>&#160;    VkPipelineRasterizationStateCreateInfo rs;</div><div class="line"><a name="l01893"></a><span class="lineno"> 1893</span>&#160;    VkPipelineColorBlendStateCreateInfo cb;</div><div class="line"><a name="l01894"></a><span class="lineno"> 1894</span>&#160;    VkPipelineDepthStencilStateCreateInfo ds;</div><div class="line"><a name="l01895"></a><span class="lineno"> 1895</span>&#160;    VkPipelineViewportStateCreateInfo vp;</div><div class="line"><a name="l01896"></a><span class="lineno"> 1896</span>&#160;    VkPipelineMultisampleStateCreateInfo ms;</div><div class="line"><a name="l01897"></a><span class="lineno"> 1897</span>&#160;    VkDynamicState dynamicStateEnables[VK_DYNAMIC_STATE_RANGE_SIZE];</div><div class="line"><a name="l01898"></a><span class="lineno"> 1898</span>&#160;    VkPipelineDynamicStateCreateInfo dynamicState;</div><div class="line"><a name="l01899"></a><span class="lineno"> 1899</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l01900"></a><span class="lineno"> 1900</span>&#160;</div><div class="line"><a name="l01901"></a><span class="lineno"> 1901</span>&#160;    memset(dynamicStateEnables, 0, <span class="keyword">sizeof</span> dynamicStateEnables);</div><div class="line"><a name="l01902"></a><span class="lineno"> 1902</span>&#160;    memset(&amp;dynamicState, 0, <span class="keyword">sizeof</span> dynamicState);</div><div class="line"><a name="l01903"></a><span class="lineno"> 1903</span>&#160;    dynamicState.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO;</div><div class="line"><a name="l01904"></a><span class="lineno"> 1904</span>&#160;    dynamicState.pDynamicStates = dynamicStateEnables;</div><div class="line"><a name="l01905"></a><span class="lineno"> 1905</span>&#160;</div><div class="line"><a name="l01906"></a><span class="lineno"> 1906</span>&#160;    memset(&amp;pipeline, 0, <span class="keyword">sizeof</span>(pipeline));</div><div class="line"><a name="l01907"></a><span class="lineno"> 1907</span>&#160;    pipeline.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;</div><div class="line"><a name="l01908"></a><span class="lineno"> 1908</span>&#160;    pipeline.layout = demo-&gt;<a class="code" href="structdemo.html#a1f9db6e3c3b5edf52eda4d2d95ad9a42">pipeline_layout</a>;</div><div class="line"><a name="l01909"></a><span class="lineno"> 1909</span>&#160;</div><div class="line"><a name="l01910"></a><span class="lineno"> 1910</span>&#160;    memset(&amp;vi, 0, <span class="keyword">sizeof</span>(vi));</div><div class="line"><a name="l01911"></a><span class="lineno"> 1911</span>&#160;    vi.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;</div><div class="line"><a name="l01912"></a><span class="lineno"> 1912</span>&#160;</div><div class="line"><a name="l01913"></a><span class="lineno"> 1913</span>&#160;    memset(&amp;ia, 0, <span class="keyword">sizeof</span>(ia));</div><div class="line"><a name="l01914"></a><span class="lineno"> 1914</span>&#160;    ia.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;</div><div class="line"><a name="l01915"></a><span class="lineno"> 1915</span>&#160;    ia.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;</div><div class="line"><a name="l01916"></a><span class="lineno"> 1916</span>&#160;</div><div class="line"><a name="l01917"></a><span class="lineno"> 1917</span>&#160;    memset(&amp;rs, 0, <span class="keyword">sizeof</span>(rs));</div><div class="line"><a name="l01918"></a><span class="lineno"> 1918</span>&#160;    rs.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;</div><div class="line"><a name="l01919"></a><span class="lineno"> 1919</span>&#160;    rs.polygonMode = VK_POLYGON_MODE_FILL;</div><div class="line"><a name="l01920"></a><span class="lineno"> 1920</span>&#160;    rs.cullMode = VK_CULL_MODE_BACK_BIT;</div><div class="line"><a name="l01921"></a><span class="lineno"> 1921</span>&#160;    rs.frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE;</div><div class="line"><a name="l01922"></a><span class="lineno"> 1922</span>&#160;    rs.depthClampEnable = VK_FALSE;</div><div class="line"><a name="l01923"></a><span class="lineno"> 1923</span>&#160;    rs.rasterizerDiscardEnable = VK_FALSE;</div><div class="line"><a name="l01924"></a><span class="lineno"> 1924</span>&#160;    rs.depthBiasEnable = VK_FALSE;</div><div class="line"><a name="l01925"></a><span class="lineno"> 1925</span>&#160;    rs.lineWidth = 1.0f;</div><div class="line"><a name="l01926"></a><span class="lineno"> 1926</span>&#160;</div><div class="line"><a name="l01927"></a><span class="lineno"> 1927</span>&#160;    memset(&amp;cb, 0, <span class="keyword">sizeof</span>(cb));</div><div class="line"><a name="l01928"></a><span class="lineno"> 1928</span>&#160;    cb.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;</div><div class="line"><a name="l01929"></a><span class="lineno"> 1929</span>&#160;    VkPipelineColorBlendAttachmentState att_state[1];</div><div class="line"><a name="l01930"></a><span class="lineno"> 1930</span>&#160;    memset(att_state, 0, <span class="keyword">sizeof</span>(att_state));</div><div class="line"><a name="l01931"></a><span class="lineno"> 1931</span>&#160;    att_state[0].colorWriteMask = 0xf;</div><div class="line"><a name="l01932"></a><span class="lineno"> 1932</span>&#160;    att_state[0].blendEnable = VK_FALSE;</div><div class="line"><a name="l01933"></a><span class="lineno"> 1933</span>&#160;    cb.attachmentCount = 1;</div><div class="line"><a name="l01934"></a><span class="lineno"> 1934</span>&#160;    cb.pAttachments = att_state;</div><div class="line"><a name="l01935"></a><span class="lineno"> 1935</span>&#160;</div><div class="line"><a name="l01936"></a><span class="lineno"> 1936</span>&#160;    memset(&amp;vp, 0, <span class="keyword">sizeof</span>(vp));</div><div class="line"><a name="l01937"></a><span class="lineno"> 1937</span>&#160;    vp.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO;</div><div class="line"><a name="l01938"></a><span class="lineno"> 1938</span>&#160;    vp.viewportCount = 1;</div><div class="line"><a name="l01939"></a><span class="lineno"> 1939</span>&#160;    dynamicStateEnables[dynamicState.dynamicStateCount++] = VK_DYNAMIC_STATE_VIEWPORT;</div><div class="line"><a name="l01940"></a><span class="lineno"> 1940</span>&#160;    vp.scissorCount = 1;</div><div class="line"><a name="l01941"></a><span class="lineno"> 1941</span>&#160;    dynamicStateEnables[dynamicState.dynamicStateCount++] = VK_DYNAMIC_STATE_SCISSOR;</div><div class="line"><a name="l01942"></a><span class="lineno"> 1942</span>&#160;</div><div class="line"><a name="l01943"></a><span class="lineno"> 1943</span>&#160;    memset(&amp;ds, 0, <span class="keyword">sizeof</span>(ds));</div><div class="line"><a name="l01944"></a><span class="lineno"> 1944</span>&#160;    ds.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO;</div><div class="line"><a name="l01945"></a><span class="lineno"> 1945</span>&#160;    ds.depthTestEnable = VK_TRUE;</div><div class="line"><a name="l01946"></a><span class="lineno"> 1946</span>&#160;    ds.depthWriteEnable = VK_TRUE;</div><div class="line"><a name="l01947"></a><span class="lineno"> 1947</span>&#160;    ds.depthCompareOp = VK_COMPARE_OP_LESS_OR_EQUAL;</div><div class="line"><a name="l01948"></a><span class="lineno"> 1948</span>&#160;    ds.depthBoundsTestEnable = VK_FALSE;</div><div class="line"><a name="l01949"></a><span class="lineno"> 1949</span>&#160;    ds.back.failOp = VK_STENCIL_OP_KEEP;</div><div class="line"><a name="l01950"></a><span class="lineno"> 1950</span>&#160;    ds.back.passOp = VK_STENCIL_OP_KEEP;</div><div class="line"><a name="l01951"></a><span class="lineno"> 1951</span>&#160;    ds.back.compareOp = VK_COMPARE_OP_ALWAYS;</div><div class="line"><a name="l01952"></a><span class="lineno"> 1952</span>&#160;    ds.stencilTestEnable = VK_FALSE;</div><div class="line"><a name="l01953"></a><span class="lineno"> 1953</span>&#160;    ds.front = ds.back;</div><div class="line"><a name="l01954"></a><span class="lineno"> 1954</span>&#160;</div><div class="line"><a name="l01955"></a><span class="lineno"> 1955</span>&#160;    memset(&amp;ms, 0, <span class="keyword">sizeof</span>(ms));</div><div class="line"><a name="l01956"></a><span class="lineno"> 1956</span>&#160;    ms.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;</div><div class="line"><a name="l01957"></a><span class="lineno"> 1957</span>&#160;    ms.pSampleMask = NULL;</div><div class="line"><a name="l01958"></a><span class="lineno"> 1958</span>&#160;    ms.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;</div><div class="line"><a name="l01959"></a><span class="lineno"> 1959</span>&#160;</div><div class="line"><a name="l01960"></a><span class="lineno"> 1960</span>&#160;    <a class="code" href="cube_8c.html#ab1d134177a8964ce85593b229fc7f688">demo_prepare_vs</a>(demo);</div><div class="line"><a name="l01961"></a><span class="lineno"> 1961</span>&#160;    <a class="code" href="cube_8c.html#ab89d9436b88fd3dea5de8cb03de51e94">demo_prepare_fs</a>(demo);</div><div class="line"><a name="l01962"></a><span class="lineno"> 1962</span>&#160;</div><div class="line"><a name="l01963"></a><span class="lineno"> 1963</span>&#160;    <span class="comment">// Two stages: vs and fs</span></div><div class="line"><a name="l01964"></a><span class="lineno"> 1964</span>&#160;    VkPipelineShaderStageCreateInfo shaderStages[2];</div><div class="line"><a name="l01965"></a><span class="lineno"> 1965</span>&#160;    memset(&amp;shaderStages, 0, 2 * <span class="keyword">sizeof</span>(VkPipelineShaderStageCreateInfo));</div><div class="line"><a name="l01966"></a><span class="lineno"> 1966</span>&#160;</div><div class="line"><a name="l01967"></a><span class="lineno"> 1967</span>&#160;    shaderStages[0].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;</div><div class="line"><a name="l01968"></a><span class="lineno"> 1968</span>&#160;    shaderStages[0].stage = VK_SHADER_STAGE_VERTEX_BIT;</div><div class="line"><a name="l01969"></a><span class="lineno"> 1969</span>&#160;    shaderStages[0].module = demo-&gt;<a class="code" href="structdemo.html#a915b8b2141dd72162d05bac9ea545831">vert_shader_module</a>;</div><div class="line"><a name="l01970"></a><span class="lineno"> 1970</span>&#160;    shaderStages[0].pName = <span class="stringliteral">&quot;main&quot;</span>;</div><div class="line"><a name="l01971"></a><span class="lineno"> 1971</span>&#160;</div><div class="line"><a name="l01972"></a><span class="lineno"> 1972</span>&#160;    shaderStages[1].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;</div><div class="line"><a name="l01973"></a><span class="lineno"> 1973</span>&#160;    shaderStages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT;</div><div class="line"><a name="l01974"></a><span class="lineno"> 1974</span>&#160;    shaderStages[1].module = demo-&gt;<a class="code" href="structdemo.html#a307ae140fd7635edef644e29226ad17b">frag_shader_module</a>;</div><div class="line"><a name="l01975"></a><span class="lineno"> 1975</span>&#160;    shaderStages[1].pName = <span class="stringliteral">&quot;main&quot;</span>;</div><div class="line"><a name="l01976"></a><span class="lineno"> 1976</span>&#160;</div><div class="line"><a name="l01977"></a><span class="lineno"> 1977</span>&#160;    memset(&amp;pipelineCache, 0, <span class="keyword">sizeof</span>(pipelineCache));</div><div class="line"><a name="l01978"></a><span class="lineno"> 1978</span>&#160;    pipelineCache.sType = VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO;</div><div class="line"><a name="l01979"></a><span class="lineno"> 1979</span>&#160;</div><div class="line"><a name="l01980"></a><span class="lineno"> 1980</span>&#160;    err = vkCreatePipelineCache(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;pipelineCache, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a3fb491730f2e5101689e1be3ebc3eb21">pipelineCache</a>);</div><div class="line"><a name="l01981"></a><span class="lineno"> 1981</span>&#160;    assert(!err);</div><div class="line"><a name="l01982"></a><span class="lineno"> 1982</span>&#160;</div><div class="line"><a name="l01983"></a><span class="lineno"> 1983</span>&#160;    pipeline.pVertexInputState = &amp;vi;</div><div class="line"><a name="l01984"></a><span class="lineno"> 1984</span>&#160;    pipeline.pInputAssemblyState = &amp;ia;</div><div class="line"><a name="l01985"></a><span class="lineno"> 1985</span>&#160;    pipeline.pRasterizationState = &amp;rs;</div><div class="line"><a name="l01986"></a><span class="lineno"> 1986</span>&#160;    pipeline.pColorBlendState = &amp;cb;</div><div class="line"><a name="l01987"></a><span class="lineno"> 1987</span>&#160;    pipeline.pMultisampleState = &amp;ms;</div><div class="line"><a name="l01988"></a><span class="lineno"> 1988</span>&#160;    pipeline.pViewportState = &amp;vp;</div><div class="line"><a name="l01989"></a><span class="lineno"> 1989</span>&#160;    pipeline.pDepthStencilState = &amp;ds;</div><div class="line"><a name="l01990"></a><span class="lineno"> 1990</span>&#160;    pipeline.stageCount = <a class="code" href="cube_8c.html#a25f003de16c08a4888b69f619d70f427">ARRAY_SIZE</a>(shaderStages);</div><div class="line"><a name="l01991"></a><span class="lineno"> 1991</span>&#160;    pipeline.pStages = shaderStages;</div><div class="line"><a name="l01992"></a><span class="lineno"> 1992</span>&#160;    pipeline.renderPass = demo-&gt;<a class="code" href="structdemo.html#a759be060753e7516d58c97f59af390ff">render_pass</a>;</div><div class="line"><a name="l01993"></a><span class="lineno"> 1993</span>&#160;    pipeline.pDynamicState = &amp;dynamicState;</div><div class="line"><a name="l01994"></a><span class="lineno"> 1994</span>&#160;</div><div class="line"><a name="l01995"></a><span class="lineno"> 1995</span>&#160;    pipeline.renderPass = demo-&gt;<a class="code" href="structdemo.html#a759be060753e7516d58c97f59af390ff">render_pass</a>;</div><div class="line"><a name="l01996"></a><span class="lineno"> 1996</span>&#160;</div><div class="line"><a name="l01997"></a><span class="lineno"> 1997</span>&#160;    err = vkCreateGraphicsPipelines(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a3fb491730f2e5101689e1be3ebc3eb21">pipelineCache</a>, 1, &amp;pipeline, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a7c5bcd70166fdff0cfb40feec15e1a97">pipeline</a>);</div><div class="line"><a name="l01998"></a><span class="lineno"> 1998</span>&#160;    assert(!err);</div><div class="line"><a name="l01999"></a><span class="lineno"> 1999</span>&#160;</div><div class="line"><a name="l02000"></a><span class="lineno"> 2000</span>&#160;    vkDestroyShaderModule(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a307ae140fd7635edef644e29226ad17b">frag_shader_module</a>, NULL);</div><div class="line"><a name="l02001"></a><span class="lineno"> 2001</span>&#160;    vkDestroyShaderModule(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a915b8b2141dd72162d05bac9ea545831">vert_shader_module</a>, NULL);</div><div class="line"><a name="l02002"></a><span class="lineno"> 2002</span>&#160;}</div><div class="ttc" id="structdemo_html_a915b8b2141dd72162d05bac9ea545831"><div class="ttname"><a href="structdemo.html#a915b8b2141dd72162d05bac9ea545831">demo::vert_shader_module</a></div><div class="ttdeci">VkShaderModule vert_shader_module</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00427">cube.c:427</a></div></div>
<div class="ttc" id="structdemo_html_a7c5bcd70166fdff0cfb40feec15e1a97"><div class="ttname"><a href="structdemo.html#a7c5bcd70166fdff0cfb40feec15e1a97">demo::pipeline</a></div><div class="ttdeci">VkPipeline pipeline</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00417">cube.c:417</a></div></div>
<div class="ttc" id="cube_8c_html_ab1d134177a8964ce85593b229fc7f688"><div class="ttname"><a href="cube_8c.html#ab1d134177a8964ce85593b229fc7f688">demo_prepare_vs</a></div><div class="ttdeci">static void demo_prepare_vs(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l01873">cube.c:1873</a></div></div>
<div class="ttc" id="cube_8c_html_ab89d9436b88fd3dea5de8cb03de51e94"><div class="ttname"><a href="cube_8c.html#ab89d9436b88fd3dea5de8cb03de51e94">demo_prepare_fs</a></div><div class="ttdeci">static void demo_prepare_fs(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l01880">cube.c:1880</a></div></div>
<div class="ttc" id="cube_8c_html_a25f003de16c08a4888b69f619d70f427"><div class="ttname"><a href="cube_8c.html#a25f003de16c08a4888b69f619d70f427">ARRAY_SIZE</a></div><div class="ttdeci">#define ARRAY_SIZE(a)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00073">cube.c:73</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_a307ae140fd7635edef644e29226ad17b"><div class="ttname"><a href="structdemo.html#a307ae140fd7635edef644e29226ad17b">demo::frag_shader_module</a></div><div class="ttdeci">VkShaderModule frag_shader_module</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00428">cube.c:428</a></div></div>
<div class="ttc" id="structdemo_html_a3fb491730f2e5101689e1be3ebc3eb21"><div class="ttname"><a href="structdemo.html#a3fb491730f2e5101689e1be3ebc3eb21">demo::pipelineCache</a></div><div class="ttdeci">VkPipelineCache pipelineCache</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00415">cube.c:415</a></div></div>
<div class="ttc" id="structdemo_html_a1f9db6e3c3b5edf52eda4d2d95ad9a42"><div class="ttname"><a href="structdemo.html#a1f9db6e3c3b5edf52eda4d2d95ad9a42">demo::pipeline_layout</a></div><div class="ttdeci">VkPipelineLayout pipeline_layout</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00413">cube.c:413</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
<div class="ttc" id="structdemo_html_a759be060753e7516d58c97f59af390ff"><div class="ttname"><a href="structdemo.html#a759be060753e7516d58c97f59af390ff">demo::render_pass</a></div><div class="ttdeci">VkRenderPass render_pass</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00416">cube.c:416</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_aa80cd8877b6b5d20217c451b207ca9d9_cgraph.png" border="0" usemap="#cube_8c_aa80cd8877b6b5d20217c451b207ca9d9_cgraph" alt=""/></div>
<map name="cube_8c_aa80cd8877b6b5d20217c451b207ca9d9_cgraph" id="cube_8c_aa80cd8877b6b5d20217c451b207ca9d9_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#ab89d9436b88fd3dea5de8cb03de51e94" title="demo_prepare_fs" alt="" coords="209,5,330,32"/>
<area shape="rect" id="node4" href="cube_8c.html#ab1d134177a8964ce85593b229fc7f688" title="demo_prepare_vs" alt="" coords="208,56,331,83"/>
<area shape="rect" id="node3" href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c" title="demo_prepare_shader\l_module" alt="" coords="379,23,529,65"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_aa80cd8877b6b5d20217c451b207ca9d9_icgraph.png" border="0" usemap="#cube_8c_aa80cd8877b6b5d20217c451b207ca9d9_icgraph" alt=""/></div>
<map name="cube_8c_aa80cd8877b6b5d20217c451b207ca9d9_icgraph" id="cube_8c_aa80cd8877b6b5d20217c451b207ca9d9_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="208,43,312,69"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="360,93,456,120"/>
<area shape="rect" id="node8" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1463,119,1536,145"/>
<area shape="rect" id="node4" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="504,93,631,120"/>
<area shape="rect" id="node6" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="881,119,969,145"/>
<area shape="rect" id="node7" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1268,119,1415,145"/>
<area shape="rect" id="node10" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1144,245,1220,272"/>
<area shape="rect" id="node5" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="679,93,833,120"/>
<area shape="rect" id="node9" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1017,156,1096,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a4ac6098487e1fc2305847f666891cdec"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_prepare_render_pass </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l01784">1784</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">demo::depth</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00376">demo::format</a>, <a class="el" href="cube_8c_source.html#l00416">demo::render_pass</a>, and <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>.</p>
<div class="fragment"><div class="line"><a name="l01784"></a><span class="lineno"> 1784</span>&#160;                                                        {</div><div class="line"><a name="l01785"></a><span class="lineno"> 1785</span>&#160;    <span class="comment">// The initial layout for the color and depth attachments will be LAYOUT_UNDEFINED</span></div><div class="line"><a name="l01786"></a><span class="lineno"> 1786</span>&#160;    <span class="comment">// because at the start of the renderpass, we don&#39;t care about their contents.</span></div><div class="line"><a name="l01787"></a><span class="lineno"> 1787</span>&#160;    <span class="comment">// At the start of the subpass, the color attachment&#39;s layout will be transitioned</span></div><div class="line"><a name="l01788"></a><span class="lineno"> 1788</span>&#160;    <span class="comment">// to LAYOUT_COLOR_ATTACHMENT_OPTIMAL and the depth stencil attachment&#39;s layout</span></div><div class="line"><a name="l01789"></a><span class="lineno"> 1789</span>&#160;    <span class="comment">// will be transitioned to LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL.  At the end of</span></div><div class="line"><a name="l01790"></a><span class="lineno"> 1790</span>&#160;    <span class="comment">// the renderpass, the color attachment&#39;s layout will be transitioned to</span></div><div class="line"><a name="l01791"></a><span class="lineno"> 1791</span>&#160;    <span class="comment">// LAYOUT_PRESENT_SRC_KHR to be ready to present.  This is all done as part of</span></div><div class="line"><a name="l01792"></a><span class="lineno"> 1792</span>&#160;    <span class="comment">// the renderpass, no barriers are necessary.</span></div><div class="line"><a name="l01793"></a><span class="lineno"> 1793</span>&#160;    <span class="keyword">const</span> VkAttachmentDescription attachments[2] = {</div><div class="line"><a name="l01794"></a><span class="lineno"> 1794</span>&#160;        [0] =</div><div class="line"><a name="l01795"></a><span class="lineno"> 1795</span>&#160;            {</div><div class="line"><a name="l01796"></a><span class="lineno"> 1796</span>&#160;                .format = demo-&gt;<a class="code" href="structdemo.html#a8d379997ae0b03bfedacc9ca8145dd71">format</a>,</div><div class="line"><a name="l01797"></a><span class="lineno"> 1797</span>&#160;                .flags = 0,</div><div class="line"><a name="l01798"></a><span class="lineno"> 1798</span>&#160;                .samples = VK_SAMPLE_COUNT_1_BIT,</div><div class="line"><a name="l01799"></a><span class="lineno"> 1799</span>&#160;                .loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,</div><div class="line"><a name="l01800"></a><span class="lineno"> 1800</span>&#160;                .storeOp = VK_ATTACHMENT_STORE_OP_STORE,</div><div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>&#160;                .stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE,</div><div class="line"><a name="l01802"></a><span class="lineno"> 1802</span>&#160;                .stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE,</div><div class="line"><a name="l01803"></a><span class="lineno"> 1803</span>&#160;                .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,</div><div class="line"><a name="l01804"></a><span class="lineno"> 1804</span>&#160;                .finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,</div><div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>&#160;            },</div><div class="line"><a name="l01806"></a><span class="lineno"> 1806</span>&#160;        [1] =</div><div class="line"><a name="l01807"></a><span class="lineno"> 1807</span>&#160;            {</div><div class="line"><a name="l01808"></a><span class="lineno"> 1808</span>&#160;                .format = demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a8d379997ae0b03bfedacc9ca8145dd71">format</a>,</div><div class="line"><a name="l01809"></a><span class="lineno"> 1809</span>&#160;                .flags = 0,</div><div class="line"><a name="l01810"></a><span class="lineno"> 1810</span>&#160;                .samples = VK_SAMPLE_COUNT_1_BIT,</div><div class="line"><a name="l01811"></a><span class="lineno"> 1811</span>&#160;                .loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,</div><div class="line"><a name="l01812"></a><span class="lineno"> 1812</span>&#160;                .storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE,</div><div class="line"><a name="l01813"></a><span class="lineno"> 1813</span>&#160;                .stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE,</div><div class="line"><a name="l01814"></a><span class="lineno"> 1814</span>&#160;                .stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE,</div><div class="line"><a name="l01815"></a><span class="lineno"> 1815</span>&#160;                .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,</div><div class="line"><a name="l01816"></a><span class="lineno"> 1816</span>&#160;                .finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,</div><div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>&#160;            },</div><div class="line"><a name="l01818"></a><span class="lineno"> 1818</span>&#160;    };</div><div class="line"><a name="l01819"></a><span class="lineno"> 1819</span>&#160;    <span class="keyword">const</span> VkAttachmentReference color_reference = {</div><div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>&#160;        .attachment = 0,</div><div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>&#160;        .layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,</div><div class="line"><a name="l01822"></a><span class="lineno"> 1822</span>&#160;    };</div><div class="line"><a name="l01823"></a><span class="lineno"> 1823</span>&#160;    <span class="keyword">const</span> VkAttachmentReference depth_reference = {</div><div class="line"><a name="l01824"></a><span class="lineno"> 1824</span>&#160;        .attachment = 1,</div><div class="line"><a name="l01825"></a><span class="lineno"> 1825</span>&#160;        .layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,</div><div class="line"><a name="l01826"></a><span class="lineno"> 1826</span>&#160;    };</div><div class="line"><a name="l01827"></a><span class="lineno"> 1827</span>&#160;    <span class="keyword">const</span> VkSubpassDescription subpass = {</div><div class="line"><a name="l01828"></a><span class="lineno"> 1828</span>&#160;        .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS,</div><div class="line"><a name="l01829"></a><span class="lineno"> 1829</span>&#160;        .flags = 0,</div><div class="line"><a name="l01830"></a><span class="lineno"> 1830</span>&#160;        .inputAttachmentCount = 0,</div><div class="line"><a name="l01831"></a><span class="lineno"> 1831</span>&#160;        .pInputAttachments = NULL,</div><div class="line"><a name="l01832"></a><span class="lineno"> 1832</span>&#160;        .colorAttachmentCount = 1,</div><div class="line"><a name="l01833"></a><span class="lineno"> 1833</span>&#160;        .pColorAttachments = &amp;color_reference,</div><div class="line"><a name="l01834"></a><span class="lineno"> 1834</span>&#160;        .pResolveAttachments = NULL,</div><div class="line"><a name="l01835"></a><span class="lineno"> 1835</span>&#160;        .pDepthStencilAttachment = &amp;depth_reference,</div><div class="line"><a name="l01836"></a><span class="lineno"> 1836</span>&#160;        .preserveAttachmentCount = 0,</div><div class="line"><a name="l01837"></a><span class="lineno"> 1837</span>&#160;        .pPreserveAttachments = NULL,</div><div class="line"><a name="l01838"></a><span class="lineno"> 1838</span>&#160;    };</div><div class="line"><a name="l01839"></a><span class="lineno"> 1839</span>&#160;    <span class="keyword">const</span> VkRenderPassCreateInfo rp_info = {</div><div class="line"><a name="l01840"></a><span class="lineno"> 1840</span>&#160;        .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,</div><div class="line"><a name="l01841"></a><span class="lineno"> 1841</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l01842"></a><span class="lineno"> 1842</span>&#160;        .flags = 0,</div><div class="line"><a name="l01843"></a><span class="lineno"> 1843</span>&#160;        .attachmentCount = 2,</div><div class="line"><a name="l01844"></a><span class="lineno"> 1844</span>&#160;        .pAttachments = attachments,</div><div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>&#160;        .subpassCount = 1,</div><div class="line"><a name="l01846"></a><span class="lineno"> 1846</span>&#160;        .pSubpasses = &amp;subpass,</div><div class="line"><a name="l01847"></a><span class="lineno"> 1847</span>&#160;        .dependencyCount = 0,</div><div class="line"><a name="l01848"></a><span class="lineno"> 1848</span>&#160;        .pDependencies = NULL,</div><div class="line"><a name="l01849"></a><span class="lineno"> 1849</span>&#160;    };</div><div class="line"><a name="l01850"></a><span class="lineno"> 1850</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l01851"></a><span class="lineno"> 1851</span>&#160;</div><div class="line"><a name="l01852"></a><span class="lineno"> 1852</span>&#160;    err = vkCreateRenderPass(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;rp_info, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a759be060753e7516d58c97f59af390ff">render_pass</a>);</div><div class="line"><a name="l01853"></a><span class="lineno"> 1853</span>&#160;    assert(!err);</div><div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>&#160;}</div><div class="ttc" id="structdemo_html_a872713baccf01389616f3bf7c2358ea0"><div class="ttname"><a href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">demo::depth</a></div><div class="ttdeci">struct demo::@0 depth</div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_a8d379997ae0b03bfedacc9ca8145dd71"><div class="ttname"><a href="structdemo.html#a8d379997ae0b03bfedacc9ca8145dd71">demo::format</a></div><div class="ttdeci">VkFormat format</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00376">cube.c:376</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
<div class="ttc" id="structdemo_html_a759be060753e7516d58c97f59af390ff"><div class="ttname"><a href="structdemo.html#a759be060753e7516d58c97f59af390ff">demo::render_pass</a></div><div class="ttdeci">VkRenderPass render_pass</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00416">cube.c:416</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a4ac6098487e1fc2305847f666891cdec_icgraph.png" border="0" usemap="#cube_8c_a4ac6098487e1fc2305847f666891cdec_icgraph" alt=""/></div>
<map name="cube_8c_a4ac6098487e1fc2305847f666891cdec_icgraph" id="cube_8c_a4ac6098487e1fc2305847f666891cdec_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="236,43,340,69"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="388,93,484,120"/>
<area shape="rect" id="node8" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1491,119,1564,145"/>
<area shape="rect" id="node4" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="532,93,659,120"/>
<area shape="rect" id="node6" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="909,119,997,145"/>
<area shape="rect" id="node7" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1296,119,1443,145"/>
<area shape="rect" id="node10" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1172,245,1248,272"/>
<area shape="rect" id="node5" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="707,93,861,120"/>
<area shape="rect" id="node9" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1045,156,1124,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a9d15bfd7acf51a14826bbfe1d52da09c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static VkShaderModule demo_prepare_shader_module </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint32_t *&#160;</td>
          <td class="paramname"><em>code</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l01856">1856</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, and <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l01880">demo_prepare_fs()</a>, and <a class="el" href="cube_8c_source.html#l01873">demo_prepare_vs()</a>.</p>
<div class="fragment"><div class="line"><a name="l01856"></a><span class="lineno"> 1856</span>&#160;                                                                                                       {</div><div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>&#160;    VkShaderModule module;</div><div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>&#160;    VkShaderModuleCreateInfo moduleCreateInfo;</div><div class="line"><a name="l01859"></a><span class="lineno"> 1859</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l01860"></a><span class="lineno"> 1860</span>&#160;</div><div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>&#160;    moduleCreateInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;</div><div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>&#160;    moduleCreateInfo.pNext = NULL;</div><div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>&#160;    moduleCreateInfo.flags = 0;</div><div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>&#160;    moduleCreateInfo.codeSize = size;</div><div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>&#160;    moduleCreateInfo.pCode = code;</div><div class="line"><a name="l01866"></a><span class="lineno"> 1866</span>&#160;</div><div class="line"><a name="l01867"></a><span class="lineno"> 1867</span>&#160;    err = vkCreateShaderModule(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;moduleCreateInfo, NULL, &amp;module);</div><div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>&#160;    assert(!err);</div><div class="line"><a name="l01869"></a><span class="lineno"> 1869</span>&#160;</div><div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>&#160;    <span class="keywordflow">return</span> module;</div><div class="line"><a name="l01871"></a><span class="lineno"> 1871</span>&#160;}</div><div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a9d15bfd7acf51a14826bbfe1d52da09c_icgraph.png" border="0" usemap="#cube_8c_a9d15bfd7acf51a14826bbfe1d52da09c_icgraph" alt=""/></div>
<map name="cube_8c_a9d15bfd7acf51a14826bbfe1d52da09c_icgraph" id="cube_8c_a9d15bfd7acf51a14826bbfe1d52da09c_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#ab89d9436b88fd3dea5de8cb03de51e94" title="demo_prepare_fs" alt="" coords="205,17,326,44"/>
<area shape="rect" id="node13" href="cube_8c.html#ab1d134177a8964ce85593b229fc7f688" title="demo_prepare_vs" alt="" coords="204,68,327,95"/>
<area shape="rect" id="node3" href="cube_8c.html#aa80cd8877b6b5d20217c451b207ca9d9" title="demo_prepare_pipeline" alt="" coords="375,43,529,69"/>
<area shape="rect" id="node4" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="577,43,681,69"/>
<area shape="rect" id="node5" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="729,93,825,120"/>
<area shape="rect" id="node10" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1832,119,1905,145"/>
<area shape="rect" id="node6" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="873,93,1000,120"/>
<area shape="rect" id="node8" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="1251,119,1339,145"/>
<area shape="rect" id="node9" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1637,119,1784,145"/>
<area shape="rect" id="node12" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1513,245,1589,272"/>
<area shape="rect" id="node7" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="1048,93,1203,120"/>
<area shape="rect" id="node11" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1387,156,1465,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a947291086c104a6dd03b8f6a2fc28731"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_prepare_texture_image </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structtexture__object.html">texture_object</a> *&#160;</td>
          <td class="paramname"><em>tex_obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VkImageTiling&#160;</td>
          <td class="paramname"><em>tiling</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VkImageUsageFlags&#160;</td>
          <td class="paramname"><em>usage</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VkFlags&#160;</td>
          <td class="paramname"><em>required_props</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l01491">1491</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00123">ERR_EXIT</a>, <a class="el" href="cube_8c_source.html#l00163">texture_object::image</a>, <a class="el" href="cube_8c_source.html#l00164">texture_object::imageLayout</a>, <a class="el" href="cube_8c_source.html#l01458">loadTexture()</a>, <a class="el" href="cube_8c_source.html#l00167">texture_object::mem</a>, <a class="el" href="cube_8c_source.html#l00166">texture_object::mem_alloc</a>, <a class="el" href="cube_8c_source.html#l00598">memory_type_from_properties()</a>, <a class="el" href="cube_8c_source.html#l00169">texture_object::tex_height</a>, <a class="el" href="cube_8c_source.html#l00169">texture_object::tex_width</a>, and <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l01574">demo_prepare_textures()</a>.</p>
<div class="fragment"><div class="line"><a name="l01492"></a><span class="lineno"> 1492</span>&#160;                                                                                                              {</div><div class="line"><a name="l01493"></a><span class="lineno"> 1493</span>&#160;    <span class="keyword">const</span> VkFormat tex_format = VK_FORMAT_R8G8B8A8_UNORM;</div><div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>&#160;    int32_t tex_width;</div><div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>&#160;    int32_t tex_height;</div><div class="line"><a name="l01496"></a><span class="lineno"> 1496</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l01497"></a><span class="lineno"> 1497</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> pass;</div><div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>&#160;</div><div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="cube_8c.html#add4fd1e03edd51503c9c554e77a042fa">loadTexture</a>(filename, NULL, NULL, &amp;tex_width, &amp;tex_height)) {</div><div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>&#160;        <a class="code" href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a>(<span class="stringliteral">&quot;Failed to load textures&quot;</span>, <span class="stringliteral">&quot;Load Texture Failure&quot;</span>);</div><div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>&#160;    }</div><div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>&#160;</div><div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>&#160;    tex_obj-&gt;<a class="code" href="structtexture__object.html#ab8ca2b13b8545ed7082ddf92bf855c10">tex_width</a> = tex_width;</div><div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>&#160;    tex_obj-&gt;<a class="code" href="structtexture__object.html#ae7b54388d144381fd7cf965e28bd4b6b">tex_height</a> = tex_height;</div><div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>&#160;</div><div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>&#160;    <span class="keyword">const</span> VkImageCreateInfo image_create_info = {</div><div class="line"><a name="l01507"></a><span class="lineno"> 1507</span>&#160;        .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,</div><div class="line"><a name="l01508"></a><span class="lineno"> 1508</span>&#160;        .pNext = NULL,</div><div class="line"><a name="l01509"></a><span class="lineno"> 1509</span>&#160;        .imageType = VK_IMAGE_TYPE_2D,</div><div class="line"><a name="l01510"></a><span class="lineno"> 1510</span>&#160;        .format = tex_format,</div><div class="line"><a name="l01511"></a><span class="lineno"> 1511</span>&#160;        .extent = {tex_width, tex_height, 1},</div><div class="line"><a name="l01512"></a><span class="lineno"> 1512</span>&#160;        .mipLevels = 1,</div><div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>&#160;        .arrayLayers = 1,</div><div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>&#160;        .samples = VK_SAMPLE_COUNT_1_BIT,</div><div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>&#160;        .tiling = tiling,</div><div class="line"><a name="l01516"></a><span class="lineno"> 1516</span>&#160;        .usage = usage,</div><div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>&#160;        .flags = 0,</div><div class="line"><a name="l01518"></a><span class="lineno"> 1518</span>&#160;        .initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED,</div><div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>&#160;    };</div><div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>&#160;</div><div class="line"><a name="l01521"></a><span class="lineno"> 1521</span>&#160;    VkMemoryRequirements mem_reqs;</div><div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>&#160;</div><div class="line"><a name="l01523"></a><span class="lineno"> 1523</span>&#160;    err = vkCreateImage(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;image_create_info, NULL, &amp;tex_obj-&gt;<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a>);</div><div class="line"><a name="l01524"></a><span class="lineno"> 1524</span>&#160;    assert(!err);</div><div class="line"><a name="l01525"></a><span class="lineno"> 1525</span>&#160;</div><div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>&#160;    vkGetImageMemoryRequirements(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, tex_obj-&gt;<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a>, &amp;mem_reqs);</div><div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>&#160;</div><div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>&#160;    tex_obj-&gt;<a class="code" href="structtexture__object.html#a199bfa22903a4ab760940922965121cb">mem_alloc</a>.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;</div><div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>&#160;    tex_obj-&gt;<a class="code" href="structtexture__object.html#a199bfa22903a4ab760940922965121cb">mem_alloc</a>.pNext = NULL;</div><div class="line"><a name="l01530"></a><span class="lineno"> 1530</span>&#160;    tex_obj-&gt;<a class="code" href="structtexture__object.html#a199bfa22903a4ab760940922965121cb">mem_alloc</a>.allocationSize = mem_reqs.size;</div><div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>&#160;    tex_obj-&gt;<a class="code" href="structtexture__object.html#a199bfa22903a4ab760940922965121cb">mem_alloc</a>.memoryTypeIndex = 0;</div><div class="line"><a name="l01532"></a><span class="lineno"> 1532</span>&#160;</div><div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>&#160;    pass = <a class="code" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b">memory_type_from_properties</a>(demo, mem_reqs.memoryTypeBits, required_props, &amp;tex_obj-&gt;<a class="code" href="structtexture__object.html#a199bfa22903a4ab760940922965121cb">mem_alloc</a>.memoryTypeIndex);</div><div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>&#160;    assert(pass);</div><div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>&#160;</div><div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>&#160;    <span class="comment">/* allocate memory */</span></div><div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>&#160;    err = vkAllocateMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;tex_obj-&gt;<a class="code" href="structtexture__object.html#a199bfa22903a4ab760940922965121cb">mem_alloc</a>, NULL, &amp;(tex_obj-&gt;<a class="code" href="structtexture__object.html#ab3ac82ddeb7e29bc9e2facbfa49f6673">mem</a>));</div><div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>&#160;    assert(!err);</div><div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>&#160;</div><div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>&#160;    <span class="comment">/* bind memory */</span></div><div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>&#160;    err = vkBindImageMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, tex_obj-&gt;<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a>, tex_obj-&gt;<a class="code" href="structtexture__object.html#ab3ac82ddeb7e29bc9e2facbfa49f6673">mem</a>, 0);</div><div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>&#160;    assert(!err);</div><div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>&#160;</div><div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>&#160;    <span class="keywordflow">if</span> (required_props &amp; VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {</div><div class="line"><a name="l01545"></a><span class="lineno"> 1545</span>&#160;        <span class="keyword">const</span> VkImageSubresource subres = {</div><div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>&#160;            .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,</div><div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>&#160;            .mipLevel = 0,</div><div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>&#160;            .arrayLayer = 0,</div><div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>&#160;        };</div><div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>&#160;        VkSubresourceLayout layout;</div><div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>&#160;        <span class="keywordtype">void</span> *data;</div><div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>&#160;</div><div class="line"><a name="l01553"></a><span class="lineno"> 1553</span>&#160;        vkGetImageSubresourceLayout(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, tex_obj-&gt;<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a>, &amp;subres, &amp;layout);</div><div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>&#160;</div><div class="line"><a name="l01555"></a><span class="lineno"> 1555</span>&#160;        err = vkMapMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, tex_obj-&gt;<a class="code" href="structtexture__object.html#ab3ac82ddeb7e29bc9e2facbfa49f6673">mem</a>, 0, tex_obj-&gt;<a class="code" href="structtexture__object.html#a199bfa22903a4ab760940922965121cb">mem_alloc</a>.allocationSize, 0, &amp;data);</div><div class="line"><a name="l01556"></a><span class="lineno"> 1556</span>&#160;        assert(!err);</div><div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>&#160;</div><div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>&#160;        <span class="keywordflow">if</span> (!<a class="code" href="cube_8c.html#add4fd1e03edd51503c9c554e77a042fa">loadTexture</a>(filename, data, &amp;layout, &amp;tex_width, &amp;tex_height)) {</div><div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>&#160;            fprintf(stderr, <span class="stringliteral">&quot;Error loading texture: %s\n&quot;</span>, filename);</div><div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>&#160;        }</div><div class="line"><a name="l01561"></a><span class="lineno"> 1561</span>&#160;</div><div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>&#160;        vkUnmapMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, tex_obj-&gt;<a class="code" href="structtexture__object.html#ab3ac82ddeb7e29bc9e2facbfa49f6673">mem</a>);</div><div class="line"><a name="l01563"></a><span class="lineno"> 1563</span>&#160;    }</div><div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>&#160;</div><div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>&#160;    tex_obj-&gt;<a class="code" href="structtexture__object.html#ad5ae110f8f38f5da86016e5bb9d9bf1b">imageLayout</a> = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;</div><div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>&#160;}</div><div class="ttc" id="structtexture__object_html_ab8ca2b13b8545ed7082ddf92bf855c10"><div class="ttname"><a href="structtexture__object.html#ab8ca2b13b8545ed7082ddf92bf855c10">texture_object::tex_width</a></div><div class="ttdeci">int32_t tex_width</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00169">cube.c:169</a></div></div>
<div class="ttc" id="cube_8c_html_add4fd1e03edd51503c9c554e77a042fa"><div class="ttname"><a href="cube_8c.html#add4fd1e03edd51503c9c554e77a042fa">loadTexture</a></div><div class="ttdeci">bool loadTexture(const char *filename, uint8_t *rgba_data, VkSubresourceLayout *layout, int32_t *width, int32_t *height)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l01458">cube.c:1458</a></div></div>
<div class="ttc" id="structtexture__object_html_ae7b54388d144381fd7cf965e28bd4b6b"><div class="ttname"><a href="structtexture__object.html#ae7b54388d144381fd7cf965e28bd4b6b">texture_object::tex_height</a></div><div class="ttdeci">int32_t tex_height</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00169">cube.c:169</a></div></div>
<div class="ttc" id="cube_8c_html_aff6bdb11d121e68bf2e3eecc2945ca3b"><div class="ttname"><a href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b">memory_type_from_properties</a></div><div class="ttdeci">static bool memory_type_from_properties(struct demo *demo, uint32_t typeBits, VkFlags requirements_mask, uint32_t *typeIndex)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00598">cube.c:598</a></div></div>
<div class="ttc" id="structtexture__object_html_a199bfa22903a4ab760940922965121cb"><div class="ttname"><a href="structtexture__object.html#a199bfa22903a4ab760940922965121cb">texture_object::mem_alloc</a></div><div class="ttdeci">VkMemoryAllocateInfo mem_alloc</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00166">cube.c:166</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structtexture__object_html_ab3ac82ddeb7e29bc9e2facbfa49f6673"><div class="ttname"><a href="structtexture__object.html#ab3ac82ddeb7e29bc9e2facbfa49f6673">texture_object::mem</a></div><div class="ttdeci">VkDeviceMemory mem</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00167">cube.c:167</a></div></div>
<div class="ttc" id="cube_8c_html_a28fe14fddb8a99da1b8a644308d1a901"><div class="ttname"><a href="cube_8c.html#a28fe14fddb8a99da1b8a644308d1a901">ERR_EXIT</a></div><div class="ttdeci">#define ERR_EXIT(err_msg, err_class)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00123">cube.c:123</a></div></div>
<div class="ttc" id="structtexture__object_html_abffe0a242253611e95ee13d9c112e01c"><div class="ttname"><a href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">texture_object::image</a></div><div class="ttdeci">VkImage image</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00163">cube.c:163</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
<div class="ttc" id="structtexture__object_html_ad5ae110f8f38f5da86016e5bb9d9bf1b"><div class="ttname"><a href="structtexture__object.html#ad5ae110f8f38f5da86016e5bb9d9bf1b">texture_object::imageLayout</a></div><div class="ttdeci">VkImageLayout imageLayout</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00164">cube.c:164</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a947291086c104a6dd03b8f6a2fc28731_cgraph.png" border="0" usemap="#cube_8c_a947291086c104a6dd03b8f6a2fc28731_cgraph" alt=""/></div>
<map name="cube_8c_a947291086c104a6dd03b8f6a2fc28731_cgraph" id="cube_8c_a947291086c104a6dd03b8f6a2fc28731_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#add4fd1e03edd51503c9c554e77a042fa" title="loadTexture" alt="" coords="258,5,347,32"/>
<area shape="rect" id="node3" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b" title="memory_type_from_properties" alt="" coords="204,56,401,83"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a947291086c104a6dd03b8f6a2fc28731_icgraph.png" border="0" usemap="#cube_8c_a947291086c104a6dd03b8f6a2fc28731_icgraph" alt=""/></div>
<map name="cube_8c_a947291086c104a6dd03b8f6a2fc28731_icgraph" id="cube_8c_a947291086c104a6dd03b8f6a2fc28731_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7" title="demo_prepare_textures" alt="" coords="204,43,363,69"/>
<area shape="rect" id="node3" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="411,43,515,69"/>
<area shape="rect" id="node4" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="563,93,659,120"/>
<area shape="rect" id="node9" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1665,119,1739,145"/>
<area shape="rect" id="node5" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="707,93,833,120"/>
<area shape="rect" id="node7" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="1084,119,1172,145"/>
<area shape="rect" id="node8" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1471,119,1617,145"/>
<area shape="rect" id="node11" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1347,245,1423,272"/>
<area shape="rect" id="node6" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="881,93,1036,120"/>
<area shape="rect" id="node10" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1220,156,1299,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a0316bd7d613330a9963098b02a6396d7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_prepare_textures </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l01574">1574</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00412">demo::cmd</a>, <a class="el" href="cube_8c_source.html#l01491">demo_prepare_texture_image()</a>, <a class="el" href="cube_8c_source.html#l00651">demo_set_image_layout()</a>, <a class="el" href="cube_8c_source.html#l00066">DEMO_TEXTURE_COUNT</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00357">demo::gpu</a>, <a class="el" href="cube_8c_source.html#l00163">texture_object::image</a>, <a class="el" href="cube_8c_source.html#l00164">texture_object::imageLayout</a>, <a class="el" href="cube_8c_source.html#l00161">texture_object::sampler</a>, <a class="el" href="cube_8c_source.html#l00410">demo::staging_texture</a>, <a class="el" href="cube_8c_source.html#l00172">tex_files</a>, <a class="el" href="cube_8c_source.html#l00169">texture_object::tex_height</a>, <a class="el" href="cube_8c_source.html#l00169">texture_object::tex_width</a>, <a class="el" href="cube_8c_source.html#l00409">demo::textures</a>, <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>, <a class="el" href="cube_8c_source.html#l00340">demo::use_staging_buffer</a>, and <a class="el" href="cube_8c_source.html#l00168">texture_object::view</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>.</p>
<div class="fragment"><div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>&#160;                                                     {</div><div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>&#160;    <span class="keyword">const</span> VkFormat tex_format = VK_FORMAT_R8G8B8A8_UNORM;</div><div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>&#160;    VkFormatProperties props;</div><div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>&#160;    uint32_t i;</div><div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>&#160;</div><div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>&#160;    vkGetPhysicalDeviceFormatProperties(demo-&gt;<a class="code" href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">gpu</a>, tex_format, &amp;props);</div><div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>&#160;</div><div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>&#160;    <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code" href="cube_8c.html#a889c754b96e13c9a94c431b8c10b7153">DEMO_TEXTURE_COUNT</a>; i++) {</div><div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>&#160;        VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>&#160;</div><div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>&#160;        <span class="keywordflow">if</span> ((props.linearTilingFeatures &amp; VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) &amp;&amp; !demo-&gt;<a class="code" href="structdemo.html#af6a82a8de928dd783df9cde04533e84d">use_staging_buffer</a>) {</div><div class="line"><a name="l01585"></a><span class="lineno"> 1585</span>&#160;            <span class="comment">/* Device can texture using linear textures */</span></div><div class="line"><a name="l01586"></a><span class="lineno"> 1586</span>&#160;            <a class="code" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731">demo_prepare_texture_image</a>(demo, <a class="code" href="cube_8c.html#a302091c8be81415de8beb0d5b5e18529">tex_files</a>[i], &amp;demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i], VK_IMAGE_TILING_LINEAR, VK_IMAGE_USAGE_SAMPLED_BIT,</div><div class="line"><a name="l01587"></a><span class="lineno"> 1587</span>&#160;                                       VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);</div><div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>&#160;            <span class="comment">// Nothing in the pipeline needs to be complete to start, and don&#39;t allow fragment</span></div><div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>&#160;            <span class="comment">// shader to run until layout transition completes</span></div><div class="line"><a name="l01590"></a><span class="lineno"> 1590</span>&#160;            <a class="code" href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8">demo_set_image_layout</a>(demo, demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a>, VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_PREINITIALIZED,</div><div class="line"><a name="l01591"></a><span class="lineno"> 1591</span>&#160;                                  demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#ad5ae110f8f38f5da86016e5bb9d9bf1b">imageLayout</a>, 0, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,</div><div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>&#160;                                  VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);</div><div class="line"><a name="l01593"></a><span class="lineno"> 1593</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#af368a567d73342ff5d8140bf76bd1f14">staging_texture</a>.<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a> = 0;</div><div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (props.optimalTilingFeatures &amp; VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) {</div><div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>&#160;            <span class="comment">/* Must use staging buffer to copy linear texture to optimized */</span></div><div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>&#160;</div><div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>&#160;            memset(&amp;demo-&gt;<a class="code" href="structdemo.html#af368a567d73342ff5d8140bf76bd1f14">staging_texture</a>, 0, <span class="keyword">sizeof</span>(demo-&gt;<a class="code" href="structdemo.html#af368a567d73342ff5d8140bf76bd1f14">staging_texture</a>));</div><div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>&#160;            <a class="code" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731">demo_prepare_texture_image</a>(demo, <a class="code" href="cube_8c.html#a302091c8be81415de8beb0d5b5e18529">tex_files</a>[i], &amp;demo-&gt;<a class="code" href="structdemo.html#af368a567d73342ff5d8140bf76bd1f14">staging_texture</a>, VK_IMAGE_TILING_LINEAR,</div><div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>&#160;                                       VK_IMAGE_USAGE_TRANSFER_SRC_BIT,</div><div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>&#160;                                       VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);</div><div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>&#160;</div><div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>&#160;            <a class="code" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731">demo_prepare_texture_image</a>(demo, <a class="code" href="cube_8c.html#a302091c8be81415de8beb0d5b5e18529">tex_files</a>[i], &amp;demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i], VK_IMAGE_TILING_OPTIMAL,</div><div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>&#160;                                       (VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT),</div><div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>&#160;                                       VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);</div><div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>&#160;</div><div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>&#160;            <a class="code" href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8">demo_set_image_layout</a>(demo, demo-&gt;<a class="code" href="structdemo.html#af368a567d73342ff5d8140bf76bd1f14">staging_texture</a>.<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a>, VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_PREINITIALIZED,</div><div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>&#160;                                  VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, 0, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,</div><div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>&#160;                                  VK_PIPELINE_STAGE_TRANSFER_BIT);</div><div class="line"><a name="l01609"></a><span class="lineno"> 1609</span>&#160;</div><div class="line"><a name="l01610"></a><span class="lineno"> 1610</span>&#160;            <a class="code" href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8">demo_set_image_layout</a>(demo, demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a>, VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_PREINITIALIZED,</div><div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>&#160;                                  VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 0, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,</div><div class="line"><a name="l01612"></a><span class="lineno"> 1612</span>&#160;                                  VK_PIPELINE_STAGE_TRANSFER_BIT);</div><div class="line"><a name="l01613"></a><span class="lineno"> 1613</span>&#160;</div><div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>&#160;            VkImageCopy copy_region = {</div><div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>&#160;                .srcSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1},</div><div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>&#160;                .srcOffset = {0, 0, 0},</div><div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>&#160;                .dstSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1},</div><div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>&#160;                .dstOffset = {0, 0, 0},</div><div class="line"><a name="l01619"></a><span class="lineno"> 1619</span>&#160;                .extent = {demo-&gt;<a class="code" href="structdemo.html#af368a567d73342ff5d8140bf76bd1f14">staging_texture</a>.<a class="code" href="structtexture__object.html#ab8ca2b13b8545ed7082ddf92bf855c10">tex_width</a>, demo-&gt;<a class="code" href="structdemo.html#af368a567d73342ff5d8140bf76bd1f14">staging_texture</a>.<a class="code" href="structtexture__object.html#ae7b54388d144381fd7cf965e28bd4b6b">tex_height</a>, 1},</div><div class="line"><a name="l01620"></a><span class="lineno"> 1620</span>&#160;            };</div><div class="line"><a name="l01621"></a><span class="lineno"> 1621</span>&#160;            vkCmdCopyImage(demo-&gt;<a class="code" href="structdemo.html#a5f52e6ec2780b7c5395983efe51bcb34">cmd</a>, demo-&gt;<a class="code" href="structdemo.html#af368a567d73342ff5d8140bf76bd1f14">staging_texture</a>.<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a>, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a>,</div><div class="line"><a name="l01622"></a><span class="lineno"> 1622</span>&#160;                           VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &amp;copy_region);</div><div class="line"><a name="l01623"></a><span class="lineno"> 1623</span>&#160;</div><div class="line"><a name="l01624"></a><span class="lineno"> 1624</span>&#160;            <a class="code" href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8">demo_set_image_layout</a>(demo, demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a>, VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,</div><div class="line"><a name="l01625"></a><span class="lineno"> 1625</span>&#160;                                  demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#ad5ae110f8f38f5da86016e5bb9d9bf1b">imageLayout</a>, VK_ACCESS_TRANSFER_WRITE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT,</div><div class="line"><a name="l01626"></a><span class="lineno"> 1626</span>&#160;                                  VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);</div><div class="line"><a name="l01627"></a><span class="lineno"> 1627</span>&#160;</div><div class="line"><a name="l01628"></a><span class="lineno"> 1628</span>&#160;        } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01629"></a><span class="lineno"> 1629</span>&#160;            <span class="comment">/* Can&#39;t support VK_FORMAT_R8G8B8A8_UNORM !? */</span></div><div class="line"><a name="l01630"></a><span class="lineno"> 1630</span>&#160;            assert(!<span class="stringliteral">&quot;No support for R8G8B8A8_UNORM as texture image format&quot;</span>);</div><div class="line"><a name="l01631"></a><span class="lineno"> 1631</span>&#160;        }</div><div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>&#160;</div><div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>&#160;        <span class="keyword">const</span> VkSamplerCreateInfo sampler = {</div><div class="line"><a name="l01634"></a><span class="lineno"> 1634</span>&#160;            .sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,</div><div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>&#160;            .pNext = NULL,</div><div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>&#160;            .magFilter = VK_FILTER_NEAREST,</div><div class="line"><a name="l01637"></a><span class="lineno"> 1637</span>&#160;            .minFilter = VK_FILTER_NEAREST,</div><div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>&#160;            .mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST,</div><div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>&#160;            .addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,</div><div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>&#160;            .addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,</div><div class="line"><a name="l01641"></a><span class="lineno"> 1641</span>&#160;            .addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,</div><div class="line"><a name="l01642"></a><span class="lineno"> 1642</span>&#160;            .mipLodBias = 0.0f,</div><div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>&#160;            .anisotropyEnable = VK_FALSE,</div><div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>&#160;            .maxAnisotropy = 1,</div><div class="line"><a name="l01645"></a><span class="lineno"> 1645</span>&#160;            .compareOp = VK_COMPARE_OP_NEVER,</div><div class="line"><a name="l01646"></a><span class="lineno"> 1646</span>&#160;            .minLod = 0.0f,</div><div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>&#160;            .maxLod = 0.0f,</div><div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>&#160;            .borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE,</div><div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>&#160;            .unnormalizedCoordinates = VK_FALSE,</div><div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>&#160;        };</div><div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>&#160;</div><div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>&#160;        VkImageViewCreateInfo view = {</div><div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>&#160;            .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,</div><div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>&#160;            .pNext = NULL,</div><div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>&#160;            .image = VK_NULL_HANDLE,</div><div class="line"><a name="l01656"></a><span class="lineno"> 1656</span>&#160;            .viewType = VK_IMAGE_VIEW_TYPE_2D,</div><div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>&#160;            .format = tex_format,</div><div class="line"><a name="l01658"></a><span class="lineno"> 1658</span>&#160;            .components =</div><div class="line"><a name="l01659"></a><span class="lineno"> 1659</span>&#160;                {</div><div class="line"><a name="l01660"></a><span class="lineno"> 1660</span>&#160;                    VK_COMPONENT_SWIZZLE_R,</div><div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>&#160;                    VK_COMPONENT_SWIZZLE_G,</div><div class="line"><a name="l01662"></a><span class="lineno"> 1662</span>&#160;                    VK_COMPONENT_SWIZZLE_B,</div><div class="line"><a name="l01663"></a><span class="lineno"> 1663</span>&#160;                    VK_COMPONENT_SWIZZLE_A,</div><div class="line"><a name="l01664"></a><span class="lineno"> 1664</span>&#160;                },</div><div class="line"><a name="l01665"></a><span class="lineno"> 1665</span>&#160;            .subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1},</div><div class="line"><a name="l01666"></a><span class="lineno"> 1666</span>&#160;            .flags = 0,</div><div class="line"><a name="l01667"></a><span class="lineno"> 1667</span>&#160;        };</div><div class="line"><a name="l01668"></a><span class="lineno"> 1668</span>&#160;</div><div class="line"><a name="l01669"></a><span class="lineno"> 1669</span>&#160;        <span class="comment">/* create sampler */</span></div><div class="line"><a name="l01670"></a><span class="lineno"> 1670</span>&#160;        err = vkCreateSampler(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;sampler, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#a3e54bffa65ec12e0bb5daa2dc4fb1efd">sampler</a>);</div><div class="line"><a name="l01671"></a><span class="lineno"> 1671</span>&#160;        assert(!err);</div><div class="line"><a name="l01672"></a><span class="lineno"> 1672</span>&#160;</div><div class="line"><a name="l01673"></a><span class="lineno"> 1673</span>&#160;        <span class="comment">/* create image view */</span></div><div class="line"><a name="l01674"></a><span class="lineno"> 1674</span>&#160;        view.image = demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a>;</div><div class="line"><a name="l01675"></a><span class="lineno"> 1675</span>&#160;        err = vkCreateImageView(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, &amp;view, NULL, &amp;demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#acf536a91cb2f8b06b4d4ea1b818c8eb1">view</a>);</div><div class="line"><a name="l01676"></a><span class="lineno"> 1676</span>&#160;        assert(!err);</div><div class="line"><a name="l01677"></a><span class="lineno"> 1677</span>&#160;    }</div><div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>&#160;}</div><div class="ttc" id="structtexture__object_html_ab8ca2b13b8545ed7082ddf92bf855c10"><div class="ttname"><a href="structtexture__object.html#ab8ca2b13b8545ed7082ddf92bf855c10">texture_object::tex_width</a></div><div class="ttdeci">int32_t tex_width</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00169">cube.c:169</a></div></div>
<div class="ttc" id="cube_8c_html_a302091c8be81415de8beb0d5b5e18529"><div class="ttname"><a href="cube_8c.html#a302091c8be81415de8beb0d5b5e18529">tex_files</a></div><div class="ttdeci">static char * tex_files[]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00172">cube.c:172</a></div></div>
<div class="ttc" id="structtexture__object_html_a3e54bffa65ec12e0bb5daa2dc4fb1efd"><div class="ttname"><a href="structtexture__object.html#a3e54bffa65ec12e0bb5daa2dc4fb1efd">texture_object::sampler</a></div><div class="ttdeci">VkSampler sampler</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00161">cube.c:161</a></div></div>
<div class="ttc" id="cube_8c_html_a889c754b96e13c9a94c431b8c10b7153"><div class="ttname"><a href="cube_8c.html#a889c754b96e13c9a94c431b8c10b7153">DEMO_TEXTURE_COUNT</a></div><div class="ttdeci">#define DEMO_TEXTURE_COUNT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00066">cube.c:66</a></div></div>
<div class="ttc" id="cube_8c_html_aba0ddac08f75117254d652598aeb72f8"><div class="ttname"><a href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8">demo_set_image_layout</a></div><div class="ttdeci">static void demo_set_image_layout(struct demo *demo, VkImage image, VkImageAspectFlags aspectMask, VkImageLayout old_image_layout, VkImageLayout new_image_layout, VkAccessFlagBits srcAccessMask, VkPipelineStageFlags src_stages, VkPipelineStageFlags dest_stages)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00651">cube.c:651</a></div></div>
<div class="ttc" id="structtexture__object_html_ae7b54388d144381fd7cf965e28bd4b6b"><div class="ttname"><a href="structtexture__object.html#ae7b54388d144381fd7cf965e28bd4b6b">texture_object::tex_height</a></div><div class="ttdeci">int32_t tex_height</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00169">cube.c:169</a></div></div>
<div class="ttc" id="structdemo_html_af368a567d73342ff5d8140bf76bd1f14"><div class="ttname"><a href="structdemo.html#af368a567d73342ff5d8140bf76bd1f14">demo::staging_texture</a></div><div class="ttdeci">struct texture_object staging_texture</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00410">cube.c:410</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="cube_8c_html_a947291086c104a6dd03b8f6a2fc28731"><div class="ttname"><a href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731">demo_prepare_texture_image</a></div><div class="ttdeci">static void demo_prepare_texture_image(struct demo *demo, const char *filename, struct texture_object *tex_obj, VkImageTiling tiling, VkImageUsageFlags usage, VkFlags required_props)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l01491">cube.c:1491</a></div></div>
<div class="ttc" id="structdemo_html_a1238f2cb459a1255d322dd141f2f4adb"><div class="ttname"><a href="structdemo.html#a1238f2cb459a1255d322dd141f2f4adb">demo::gpu</a></div><div class="ttdeci">VkPhysicalDevice gpu</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00357">cube.c:357</a></div></div>
<div class="ttc" id="structdemo_html_a069de0b6f83a6c8af47b14dc76e52ee5"><div class="ttname"><a href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">demo::textures</a></div><div class="ttdeci">struct texture_object textures[DEMO_TEXTURE_COUNT]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00409">cube.c:409</a></div></div>
<div class="ttc" id="structtexture__object_html_acf536a91cb2f8b06b4d4ea1b818c8eb1"><div class="ttname"><a href="structtexture__object.html#acf536a91cb2f8b06b4d4ea1b818c8eb1">texture_object::view</a></div><div class="ttdeci">VkImageView view</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00168">cube.c:168</a></div></div>
<div class="ttc" id="structtexture__object_html_abffe0a242253611e95ee13d9c112e01c"><div class="ttname"><a href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">texture_object::image</a></div><div class="ttdeci">VkImage image</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00163">cube.c:163</a></div></div>
<div class="ttc" id="structdemo_html_a5f52e6ec2780b7c5395983efe51bcb34"><div class="ttname"><a href="structdemo.html#a5f52e6ec2780b7c5395983efe51bcb34">demo::cmd</a></div><div class="ttdeci">VkCommandBuffer cmd</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00412">cube.c:412</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
<div class="ttc" id="structdemo_html_af6a82a8de928dd783df9cde04533e84d"><div class="ttname"><a href="structdemo.html#af6a82a8de928dd783df9cde04533e84d">demo::use_staging_buffer</a></div><div class="ttdeci">bool use_staging_buffer</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00340">cube.c:340</a></div></div>
<div class="ttc" id="structtexture__object_html_ad5ae110f8f38f5da86016e5bb9d9bf1b"><div class="ttname"><a href="structtexture__object.html#ad5ae110f8f38f5da86016e5bb9d9bf1b">texture_object::imageLayout</a></div><div class="ttdeci">VkImageLayout imageLayout</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00164">cube.c:164</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a0316bd7d613330a9963098b02a6396d7_cgraph.png" border="0" usemap="#cube_8c_a0316bd7d613330a9963098b02a6396d7_cgraph" alt=""/></div>
<map name="cube_8c_a0316bd7d613330a9963098b02a6396d7_cgraph" id="cube_8c_a0316bd7d613330a9963098b02a6396d7_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731" title="demo_prepare_texture\l_image" alt="" coords="218,23,369,65"/>
<area shape="rect" id="node5" href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8" title="demo_set_image_layout" alt="" coords="212,89,375,116"/>
<area shape="rect" id="node3" href="cube_8c.html#add4fd1e03edd51503c9c554e77a042fa" title="loadTexture" alt="" coords="477,5,566,32"/>
<area shape="rect" id="node4" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b" title="memory_type_from_properties" alt="" coords="423,56,620,83"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a0316bd7d613330a9963098b02a6396d7_icgraph.png" border="0" usemap="#cube_8c_a0316bd7d613330a9963098b02a6396d7_icgraph" alt=""/></div>
<map name="cube_8c_a0316bd7d613330a9963098b02a6396d7_icgraph" id="cube_8c_a0316bd7d613330a9963098b02a6396d7_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="212,43,316,69"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="364,93,460,120"/>
<area shape="rect" id="node8" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1467,119,1540,145"/>
<area shape="rect" id="node4" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="508,93,635,120"/>
<area shape="rect" id="node6" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="885,119,973,145"/>
<area shape="rect" id="node7" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1272,119,1419,145"/>
<area shape="rect" id="node10" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1148,245,1224,272"/>
<area shape="rect" id="node5" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="683,93,837,120"/>
<area shape="rect" id="node9" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1021,156,1100,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ab1d134177a8964ce85593b229fc7f688"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_prepare_vs </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l01873">1873</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l01856">demo_prepare_shader_module()</a>, and <a class="el" href="cube_8c_source.html#l00427">demo::vert_shader_module</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l01887">demo_prepare_pipeline()</a>.</p>
<div class="fragment"><div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>&#160;                                               {</div><div class="line"><a name="l01874"></a><span class="lineno"> 1874</span>&#160;    <span class="keyword">const</span> uint32_t vs_code[] = {</div><div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>&#160;<span class="preprocessor">#include &quot;cube.vert.inc&quot;</span></div><div class="line"><a name="l01876"></a><span class="lineno"> 1876</span>&#160;    };</div><div class="line"><a name="l01877"></a><span class="lineno"> 1877</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a915b8b2141dd72162d05bac9ea545831">vert_shader_module</a> = <a class="code" href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c">demo_prepare_shader_module</a>(demo, vs_code, <span class="keyword">sizeof</span>(vs_code));</div><div class="line"><a name="l01878"></a><span class="lineno"> 1878</span>&#160;}</div><div class="ttc" id="structdemo_html_a915b8b2141dd72162d05bac9ea545831"><div class="ttname"><a href="structdemo.html#a915b8b2141dd72162d05bac9ea545831">demo::vert_shader_module</a></div><div class="ttdeci">VkShaderModule vert_shader_module</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00427">cube.c:427</a></div></div>
<div class="ttc" id="cube_8c_html_a9d15bfd7acf51a14826bbfe1d52da09c"><div class="ttname"><a href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c">demo_prepare_shader_module</a></div><div class="ttdeci">static VkShaderModule demo_prepare_shader_module(struct demo *demo, const uint32_t *code, size_t size)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l01856">cube.c:1856</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ab1d134177a8964ce85593b229fc7f688_cgraph.png" border="0" usemap="#cube_8c_ab1d134177a8964ce85593b229fc7f688_cgraph" alt=""/></div>
<map name="cube_8c_ab1d134177a8964ce85593b229fc7f688_cgraph" id="cube_8c_ab1d134177a8964ce85593b229fc7f688_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c" title="demo_prepare_shader\l_module" alt="" coords="176,5,327,47"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ab1d134177a8964ce85593b229fc7f688_icgraph.png" border="0" usemap="#cube_8c_ab1d134177a8964ce85593b229fc7f688_icgraph" alt=""/></div>
<map name="cube_8c_ab1d134177a8964ce85593b229fc7f688_icgraph" id="cube_8c_ab1d134177a8964ce85593b229fc7f688_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#aa80cd8877b6b5d20217c451b207ca9d9" title="demo_prepare_pipeline" alt="" coords="176,43,331,69"/>
<area shape="rect" id="node3" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="379,43,483,69"/>
<area shape="rect" id="node4" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="531,93,627,120"/>
<area shape="rect" id="node9" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1633,119,1707,145"/>
<area shape="rect" id="node5" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="675,93,801,120"/>
<area shape="rect" id="node7" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="1052,119,1140,145"/>
<area shape="rect" id="node8" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1439,119,1585,145"/>
<area shape="rect" id="node11" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1315,245,1391,272"/>
<area shape="rect" id="node6" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="849,93,1004,120"/>
<area shape="rect" id="node10" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1188,156,1267,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ac51a47d75843a542182cb6c2e997c67a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_resize </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l02283">2283</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00296">SwapchainImageResources::cmd</a>, <a class="el" href="cube_8c_source.html#l00397">demo::cmd_pool</a>, <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>, <a class="el" href="cube_8c_source.html#l00066">DEMO_TEXTURE_COUNT</a>, <a class="el" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">demo::depth</a>, <a class="el" href="cube_8c_source.html#l00414">demo::desc_layout</a>, <a class="el" href="cube_8c_source.html#l00430">demo::desc_pool</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00301">SwapchainImageResources::framebuffer</a>, <a class="el" href="cube_8c_source.html#l00163">texture_object::image</a>, <a class="el" href="cube_8c_source.html#l00403">demo::image</a>, <a class="el" href="cube_8c_source.html#l00342">demo::is_minimized</a>, <a class="el" href="cube_8c_source.html#l00167">texture_object::mem</a>, <a class="el" href="cube_8c_source.html#l00405">demo::mem</a>, <a class="el" href="cube_8c_source.html#l00417">demo::pipeline</a>, <a class="el" href="cube_8c_source.html#l00413">demo::pipeline_layout</a>, <a class="el" href="cube_8c_source.html#l00415">demo::pipelineCache</a>, <a class="el" href="cube_8c_source.html#l00339">demo::prepared</a>, <a class="el" href="cube_8c_source.html#l00398">demo::present_cmd_pool</a>, <a class="el" href="cube_8c_source.html#l00416">demo::render_pass</a>, <a class="el" href="cube_8c_source.html#l00161">texture_object::sampler</a>, <a class="el" href="cube_8c_source.html#l00341">demo::separate_present_queue</a>, <a class="el" href="cube_8c_source.html#l00392">demo::swapchain_image_resources</a>, <a class="el" href="cube_8c_source.html#l00390">demo::swapchainImageCount</a>, <a class="el" href="cube_8c_source.html#l00409">demo::textures</a>, <a class="el" href="cube_8c_source.html#l00299">SwapchainImageResources::uniform_buffer</a>, <a class="el" href="cube_8c_source.html#l00300">SwapchainImageResources::uniform_memory</a>, <a class="el" href="cube_8c_source.html#l00168">texture_object::view</a>, <a class="el" href="cube_8c_source.html#l00298">SwapchainImageResources::view</a>, and <a class="el" href="cube_8c_source.html#l00406">demo::view</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l00579">CanPresentEarlier()</a>, <a class="el" href="cube_8c_source.html#l02387">demo_create_window()</a>, <a class="el" href="cube_8c_source.html#l01003">demo_draw()</a>, and <a class="el" href="cube_8c_source.html#l02355">WndProc()</a>.</p>
<div class="fragment"><div class="line"><a name="l02283"></a><span class="lineno"> 2283</span>&#160;                                           {</div><div class="line"><a name="l02284"></a><span class="lineno"> 2284</span>&#160;    uint32_t i;</div><div class="line"><a name="l02285"></a><span class="lineno"> 2285</span>&#160;</div><div class="line"><a name="l02286"></a><span class="lineno"> 2286</span>&#160;    <span class="comment">// Don&#39;t react to resize until after first initialization.</span></div><div class="line"><a name="l02287"></a><span class="lineno"> 2287</span>&#160;    <span class="keywordflow">if</span> (!demo-&gt;<a class="code" href="structdemo.html#a37de313a90cfadb40755d35e8d70f704">prepared</a>) {</div><div class="line"><a name="l02288"></a><span class="lineno"> 2288</span>&#160;        <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#ac2570a83ce706add3b8a07673237f30c">is_minimized</a>) {</div><div class="line"><a name="l02289"></a><span class="lineno"> 2289</span>&#160;            <a class="code" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da">demo_prepare</a>(demo);</div><div class="line"><a name="l02290"></a><span class="lineno"> 2290</span>&#160;        }</div><div class="line"><a name="l02291"></a><span class="lineno"> 2291</span>&#160;        <span class="keywordflow">return</span>;</div><div class="line"><a name="l02292"></a><span class="lineno"> 2292</span>&#160;    }</div><div class="line"><a name="l02293"></a><span class="lineno"> 2293</span>&#160;    <span class="comment">// In order to properly resize the window, we must re-create the swapchain</span></div><div class="line"><a name="l02294"></a><span class="lineno"> 2294</span>&#160;    <span class="comment">// AND redo the command buffers, etc.</span></div><div class="line"><a name="l02295"></a><span class="lineno"> 2295</span>&#160;    <span class="comment">//</span></div><div class="line"><a name="l02296"></a><span class="lineno"> 2296</span>&#160;    <span class="comment">// First, perform part of the demo_cleanup() function:</span></div><div class="line"><a name="l02297"></a><span class="lineno"> 2297</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a37de313a90cfadb40755d35e8d70f704">prepared</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l02298"></a><span class="lineno"> 2298</span>&#160;    vkDeviceWaitIdle(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>);</div><div class="line"><a name="l02299"></a><span class="lineno"> 2299</span>&#160;</div><div class="line"><a name="l02300"></a><span class="lineno"> 2300</span>&#160;    <span class="keywordflow">for</span> (i = 0; i &lt; demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>; i++) {</div><div class="line"><a name="l02301"></a><span class="lineno"> 2301</span>&#160;        vkDestroyFramebuffer(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a09729b546f1f1017e0052fd076299776">framebuffer</a>, NULL);</div><div class="line"><a name="l02302"></a><span class="lineno"> 2302</span>&#160;    }</div><div class="line"><a name="l02303"></a><span class="lineno"> 2303</span>&#160;    vkDestroyDescriptorPool(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a20263af0f46296860c8053ee113fa9f8">desc_pool</a>, NULL);</div><div class="line"><a name="l02304"></a><span class="lineno"> 2304</span>&#160;</div><div class="line"><a name="l02305"></a><span class="lineno"> 2305</span>&#160;    vkDestroyPipeline(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a7c5bcd70166fdff0cfb40feec15e1a97">pipeline</a>, NULL);</div><div class="line"><a name="l02306"></a><span class="lineno"> 2306</span>&#160;    vkDestroyPipelineCache(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a3fb491730f2e5101689e1be3ebc3eb21">pipelineCache</a>, NULL);</div><div class="line"><a name="l02307"></a><span class="lineno"> 2307</span>&#160;    vkDestroyRenderPass(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a759be060753e7516d58c97f59af390ff">render_pass</a>, NULL);</div><div class="line"><a name="l02308"></a><span class="lineno"> 2308</span>&#160;    vkDestroyPipelineLayout(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a1f9db6e3c3b5edf52eda4d2d95ad9a42">pipeline_layout</a>, NULL);</div><div class="line"><a name="l02309"></a><span class="lineno"> 2309</span>&#160;    vkDestroyDescriptorSetLayout(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a2bdc8b6c1791c08c4b6ad61873b30155">desc_layout</a>, NULL);</div><div class="line"><a name="l02310"></a><span class="lineno"> 2310</span>&#160;</div><div class="line"><a name="l02311"></a><span class="lineno"> 2311</span>&#160;    <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code" href="cube_8c.html#a889c754b96e13c9a94c431b8c10b7153">DEMO_TEXTURE_COUNT</a>; i++) {</div><div class="line"><a name="l02312"></a><span class="lineno"> 2312</span>&#160;        vkDestroyImageView(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#acf536a91cb2f8b06b4d4ea1b818c8eb1">view</a>, NULL);</div><div class="line"><a name="l02313"></a><span class="lineno"> 2313</span>&#160;        vkDestroyImage(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">image</a>, NULL);</div><div class="line"><a name="l02314"></a><span class="lineno"> 2314</span>&#160;        vkFreeMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#ab3ac82ddeb7e29bc9e2facbfa49f6673">mem</a>, NULL);</div><div class="line"><a name="l02315"></a><span class="lineno"> 2315</span>&#160;        vkDestroySampler(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">textures</a>[i].<a class="code" href="structtexture__object.html#a3e54bffa65ec12e0bb5daa2dc4fb1efd">sampler</a>, NULL);</div><div class="line"><a name="l02316"></a><span class="lineno"> 2316</span>&#160;    }</div><div class="line"><a name="l02317"></a><span class="lineno"> 2317</span>&#160;</div><div class="line"><a name="l02318"></a><span class="lineno"> 2318</span>&#160;    vkDestroyImageView(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a2acac138a169a49cb7ecb1e066249079">view</a>, NULL);</div><div class="line"><a name="l02319"></a><span class="lineno"> 2319</span>&#160;    vkDestroyImage(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a7b314d782d35c91b31bd7e810f42d2d3">image</a>, NULL);</div><div class="line"><a name="l02320"></a><span class="lineno"> 2320</span>&#160;    vkFreeMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">depth</a>.<a class="code" href="structdemo.html#a506c89485b5987ac326e4616e20d38d1">mem</a>, NULL);</div><div class="line"><a name="l02321"></a><span class="lineno"> 2321</span>&#160;</div><div class="line"><a name="l02322"></a><span class="lineno"> 2322</span>&#160;    <span class="keywordflow">for</span> (i = 0; i &lt; demo-&gt;<a class="code" href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">swapchainImageCount</a>; i++) {</div><div class="line"><a name="l02323"></a><span class="lineno"> 2323</span>&#160;        vkDestroyImageView(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a2fc87148f25f154eaeaf7dc2cdef135d">view</a>, NULL);</div><div class="line"><a name="l02324"></a><span class="lineno"> 2324</span>&#160;        vkFreeCommandBuffers(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#af527d51e6fafb65fec23e3b95b622b93">cmd_pool</a>, 1, &amp;demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a01f3d0317c7802a763e58e9817b7f3c2">cmd</a>);</div><div class="line"><a name="l02325"></a><span class="lineno"> 2325</span>&#160;        vkDestroyBuffer(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a73375235ed97731ad09a1400d9a50d63">uniform_buffer</a>, NULL);</div><div class="line"><a name="l02326"></a><span class="lineno"> 2326</span>&#160;        vkFreeMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[i].<a class="code" href="struct_swapchain_image_resources.html#a2e342d29ed730c31f00de806b8bfb4b2">uniform_memory</a>, NULL);</div><div class="line"><a name="l02327"></a><span class="lineno"> 2327</span>&#160;    }</div><div class="line"><a name="l02328"></a><span class="lineno"> 2328</span>&#160;    vkDestroyCommandPool(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#af527d51e6fafb65fec23e3b95b622b93">cmd_pool</a>, NULL);</div><div class="line"><a name="l02329"></a><span class="lineno"> 2329</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#af527d51e6fafb65fec23e3b95b622b93">cmd_pool</a> = VK_NULL_HANDLE;</div><div class="line"><a name="l02330"></a><span class="lineno"> 2330</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">separate_present_queue</a>) {</div><div class="line"><a name="l02331"></a><span class="lineno"> 2331</span>&#160;        vkDestroyCommandPool(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#acc57b4fdd35d5caf270586100354ba6c">present_cmd_pool</a>, NULL);</div><div class="line"><a name="l02332"></a><span class="lineno"> 2332</span>&#160;    }</div><div class="line"><a name="l02333"></a><span class="lineno"> 2333</span>&#160;    free(demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>);</div><div class="line"><a name="l02334"></a><span class="lineno"> 2334</span>&#160;</div><div class="line"><a name="l02335"></a><span class="lineno"> 2335</span>&#160;    <span class="comment">// Second, re-perform the demo_prepare() function, which will re-create the</span></div><div class="line"><a name="l02336"></a><span class="lineno"> 2336</span>&#160;    <span class="comment">// swapchain:</span></div><div class="line"><a name="l02337"></a><span class="lineno"> 2337</span>&#160;    <a class="code" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da">demo_prepare</a>(demo);</div><div class="line"><a name="l02338"></a><span class="lineno"> 2338</span>&#160;}</div><div class="ttc" id="structdemo_html_a37de313a90cfadb40755d35e8d70f704"><div class="ttname"><a href="structdemo.html#a37de313a90cfadb40755d35e8d70f704">demo::prepared</a></div><div class="ttdeci">bool prepared</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00339">cube.c:339</a></div></div>
<div class="ttc" id="structdemo_html_a337380c3a804d2cb24e6ce3a5ecc80e5"><div class="ttname"><a href="structdemo.html#a337380c3a804d2cb24e6ce3a5ecc80e5">demo::swapchainImageCount</a></div><div class="ttdeci">uint32_t swapchainImageCount</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00390">cube.c:390</a></div></div>
<div class="ttc" id="structdemo_html_a7c5bcd70166fdff0cfb40feec15e1a97"><div class="ttname"><a href="structdemo.html#a7c5bcd70166fdff0cfb40feec15e1a97">demo::pipeline</a></div><div class="ttdeci">VkPipeline pipeline</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00417">cube.c:417</a></div></div>
<div class="ttc" id="structdemo_html_a506c89485b5987ac326e4616e20d38d1"><div class="ttname"><a href="structdemo.html#a506c89485b5987ac326e4616e20d38d1">demo::mem</a></div><div class="ttdeci">VkDeviceMemory mem</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00405">cube.c:405</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a2fc87148f25f154eaeaf7dc2cdef135d"><div class="ttname"><a href="struct_swapchain_image_resources.html#a2fc87148f25f154eaeaf7dc2cdef135d">SwapchainImageResources::view</a></div><div class="ttdeci">VkImageView view</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00298">cube.c:298</a></div></div>
<div class="ttc" id="structtexture__object_html_a3e54bffa65ec12e0bb5daa2dc4fb1efd"><div class="ttname"><a href="structtexture__object.html#a3e54bffa65ec12e0bb5daa2dc4fb1efd">texture_object::sampler</a></div><div class="ttdeci">VkSampler sampler</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00161">cube.c:161</a></div></div>
<div class="ttc" id="structdemo_html_af527d51e6fafb65fec23e3b95b622b93"><div class="ttname"><a href="structdemo.html#af527d51e6fafb65fec23e3b95b622b93">demo::cmd_pool</a></div><div class="ttdeci">VkCommandPool cmd_pool</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00397">cube.c:397</a></div></div>
<div class="ttc" id="cube_8c_html_a889c754b96e13c9a94c431b8c10b7153"><div class="ttname"><a href="cube_8c.html#a889c754b96e13c9a94c431b8c10b7153">DEMO_TEXTURE_COUNT</a></div><div class="ttdeci">#define DEMO_TEXTURE_COUNT</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00066">cube.c:66</a></div></div>
<div class="ttc" id="structdemo_html_a139cab94cb0a578562759d7f315ca0b5"><div class="ttname"><a href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">demo::swapchain_image_resources</a></div><div class="ttdeci">SwapchainImageResources * swapchain_image_resources</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00392">cube.c:392</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a2e342d29ed730c31f00de806b8bfb4b2"><div class="ttname"><a href="struct_swapchain_image_resources.html#a2e342d29ed730c31f00de806b8bfb4b2">SwapchainImageResources::uniform_memory</a></div><div class="ttdeci">VkDeviceMemory uniform_memory</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00300">cube.c:300</a></div></div>
<div class="ttc" id="structdemo_html_a872713baccf01389616f3bf7c2358ea0"><div class="ttname"><a href="structdemo.html#a872713baccf01389616f3bf7c2358ea0">demo::depth</a></div><div class="ttdeci">struct demo::@0 depth</div></div>
<div class="ttc" id="cube_8c_html_a0fcfc933d495ab4fcf98493677e3d8da"><div class="ttname"><a href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da">demo_prepare</a></div><div class="ttdeci">static void demo_prepare(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l02099">cube.c:2099</a></div></div>
<div class="ttc" id="structdemo_html_a2bdc8b6c1791c08c4b6ad61873b30155"><div class="ttname"><a href="structdemo.html#a2bdc8b6c1791c08c4b6ad61873b30155">demo::desc_layout</a></div><div class="ttdeci">VkDescriptorSetLayout desc_layout</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00414">cube.c:414</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a09729b546f1f1017e0052fd076299776"><div class="ttname"><a href="struct_swapchain_image_resources.html#a09729b546f1f1017e0052fd076299776">SwapchainImageResources::framebuffer</a></div><div class="ttdeci">VkFramebuffer framebuffer</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00301">cube.c:301</a></div></div>
<div class="ttc" id="structdemo_html_ac2570a83ce706add3b8a07673237f30c"><div class="ttname"><a href="structdemo.html#ac2570a83ce706add3b8a07673237f30c">demo::is_minimized</a></div><div class="ttdeci">bool is_minimized</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00342">cube.c:342</a></div></div>
<div class="ttc" id="structdemo_html_acc57b4fdd35d5caf270586100354ba6c"><div class="ttname"><a href="structdemo.html#acc57b4fdd35d5caf270586100354ba6c">demo::present_cmd_pool</a></div><div class="ttdeci">VkCommandPool present_cmd_pool</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00398">cube.c:398</a></div></div>
<div class="ttc" id="structdemo_html_a2acac138a169a49cb7ecb1e066249079"><div class="ttname"><a href="structdemo.html#a2acac138a169a49cb7ecb1e066249079">demo::view</a></div><div class="ttdeci">VkImageView view</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00406">cube.c:406</a></div></div>
<div class="ttc" id="structdemo_html_a3fb491730f2e5101689e1be3ebc3eb21"><div class="ttname"><a href="structdemo.html#a3fb491730f2e5101689e1be3ebc3eb21">demo::pipelineCache</a></div><div class="ttdeci">VkPipelineCache pipelineCache</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00415">cube.c:415</a></div></div>
<div class="ttc" id="structdemo_html_a1f9db6e3c3b5edf52eda4d2d95ad9a42"><div class="ttname"><a href="structdemo.html#a1f9db6e3c3b5edf52eda4d2d95ad9a42">demo::pipeline_layout</a></div><div class="ttdeci">VkPipelineLayout pipeline_layout</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00413">cube.c:413</a></div></div>
<div class="ttc" id="structdemo_html_a20263af0f46296860c8053ee113fa9f8"><div class="ttname"><a href="structdemo.html#a20263af0f46296860c8053ee113fa9f8">demo::desc_pool</a></div><div class="ttdeci">VkDescriptorPool desc_pool</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00430">cube.c:430</a></div></div>
<div class="ttc" id="structtexture__object_html_ab3ac82ddeb7e29bc9e2facbfa49f6673"><div class="ttname"><a href="structtexture__object.html#ab3ac82ddeb7e29bc9e2facbfa49f6673">texture_object::mem</a></div><div class="ttdeci">VkDeviceMemory mem</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00167">cube.c:167</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a01f3d0317c7802a763e58e9817b7f3c2"><div class="ttname"><a href="struct_swapchain_image_resources.html#a01f3d0317c7802a763e58e9817b7f3c2">SwapchainImageResources::cmd</a></div><div class="ttdeci">VkCommandBuffer cmd</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00296">cube.c:296</a></div></div>
<div class="ttc" id="structdemo_html_a069de0b6f83a6c8af47b14dc76e52ee5"><div class="ttname"><a href="structdemo.html#a069de0b6f83a6c8af47b14dc76e52ee5">demo::textures</a></div><div class="ttdeci">struct texture_object textures[DEMO_TEXTURE_COUNT]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00409">cube.c:409</a></div></div>
<div class="ttc" id="structtexture__object_html_acf536a91cb2f8b06b4d4ea1b818c8eb1"><div class="ttname"><a href="structtexture__object.html#acf536a91cb2f8b06b4d4ea1b818c8eb1">texture_object::view</a></div><div class="ttdeci">VkImageView view</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00168">cube.c:168</a></div></div>
<div class="ttc" id="structdemo_html_a7b314d782d35c91b31bd7e810f42d2d3"><div class="ttname"><a href="structdemo.html#a7b314d782d35c91b31bd7e810f42d2d3">demo::image</a></div><div class="ttdeci">VkImage image</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00403">cube.c:403</a></div></div>
<div class="ttc" id="structdemo_html_a894fb54cff1b88236c70332f35c40e04"><div class="ttname"><a href="structdemo.html#a894fb54cff1b88236c70332f35c40e04">demo::separate_present_queue</a></div><div class="ttdeci">bool separate_present_queue</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00341">cube.c:341</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a73375235ed97731ad09a1400d9a50d63"><div class="ttname"><a href="struct_swapchain_image_resources.html#a73375235ed97731ad09a1400d9a50d63">SwapchainImageResources::uniform_buffer</a></div><div class="ttdeci">VkBuffer uniform_buffer</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00299">cube.c:299</a></div></div>
<div class="ttc" id="structtexture__object_html_abffe0a242253611e95ee13d9c112e01c"><div class="ttname"><a href="structtexture__object.html#abffe0a242253611e95ee13d9c112e01c">texture_object::image</a></div><div class="ttdeci">VkImage image</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00163">cube.c:163</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
<div class="ttc" id="structdemo_html_a759be060753e7516d58c97f59af390ff"><div class="ttname"><a href="structdemo.html#a759be060753e7516d58c97f59af390ff">demo::render_pass</a></div><div class="ttdeci">VkRenderPass render_pass</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00416">cube.c:416</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ac51a47d75843a542182cb6c2e997c67a_cgraph.png" border="0" usemap="#cube_8c_ac51a47d75843a542182cb6c2e997c67a_cgraph" alt=""/></div>
<map name="cube_8c_ac51a47d75843a542182cb6c2e997c67a_cgraph" id="cube_8c_ac51a47d75843a542182cb6c2e997c67a_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="149,351,253,377"/>
<area shape="rect" id="node3" href="cube_8c.html#ad1571a7e9407fa30327f858d07ea6702" title="demo_build_image_ownership_cmd" alt="" coords="301,5,528,32"/>
<area shape="rect" id="node4" href="cube_8c.html#a10612fc5c33836b531554ee572b389f2" title="demo_destroy_texture\l_image" alt="" coords="339,57,490,98"/>
<area shape="rect" id="node5" href="cube_8c.html#aa9f275ddb85f8473f44c01a00ccfba63" title="demo_draw_build_cmd" alt="" coords="337,123,492,149"/>
<area shape="rect" id="node6" href="cube_8c.html#a7a35f4639d32b3ac59dd725668a363ba" title="demo_flush_init_cmd" alt="" coords="343,173,487,200"/>
<area shape="rect" id="node7" href="cube_8c.html#a0c4cc92dc1a3456d6cca76e3187f2010" title="demo_prepare_buffers" alt="" coords="340,224,489,251"/>
<area shape="rect" id="node8" href="cube_8c.html#a21da8dc23d75bc75b5dbe7dd01130739" title="demo_prepare_cube_data\l_buffers" alt="" coords="576,255,747,297"/>
<area shape="rect" id="node10" href="cube_8c.html#a3569c83afeb4ecc4d8d797af29ce89ed" title="demo_prepare_depth" alt="" coords="590,321,733,348"/>
<area shape="rect" id="node11" href="cube_8c.html#a36308c10e305d94d63e96fc82be78950" title="demo_prepare_descriptor\l_layout" alt="" coords="331,427,499,469"/>
<area shape="rect" id="node12" href="cube_8c.html#a4ee7f5efc65c5972db015c6be8cda380" title="demo_prepare_descriptor_pool" alt="" coords="315,493,514,520"/>
<area shape="rect" id="node13" href="cube_8c.html#ac1957f225fabd1755a0064169fa5f6ba" title="demo_prepare_descriptor_set" alt="" coords="318,544,511,571"/>
<area shape="rect" id="node14" href="cube_8c.html#a3a72610dc44a370494307b568ef3abd6" title="demo_prepare_framebuffers" alt="" coords="324,595,505,621"/>
<area shape="rect" id="node15" href="cube_8c.html#aa80cd8877b6b5d20217c451b207ca9d9" title="demo_prepare_pipeline" alt="" coords="337,645,492,672"/>
<area shape="rect" id="node19" href="cube_8c.html#a4ac6098487e1fc2305847f666891cdec" title="demo_prepare_render_pass" alt="" coords="323,696,506,723"/>
<area shape="rect" id="node20" href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7" title="demo_prepare_textures" alt="" coords="335,376,494,403"/>
<area shape="rect" id="node9" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b" title="memory_type_from_properties" alt="" coords="795,321,992,348"/>
<area shape="rect" id="node16" href="cube_8c.html#ab89d9436b88fd3dea5de8cb03de51e94" title="demo_prepare_fs" alt="" coords="601,620,722,647"/>
<area shape="rect" id="node18" href="cube_8c.html#ab1d134177a8964ce85593b229fc7f688" title="demo_prepare_vs" alt="" coords="600,671,723,697"/>
<area shape="rect" id="node17" href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c" title="demo_prepare_shader\l_module" alt="" coords="818,638,969,679"/>
<area shape="rect" id="node21" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731" title="demo_prepare_texture\l_image" alt="" coords="586,373,737,414"/>
<area shape="rect" id="node23" href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8" title="demo_set_image_layout" alt="" coords="580,439,743,465"/>
<area shape="rect" id="node22" href="cube_8c.html#add4fd1e03edd51503c9c554e77a042fa" title="loadTexture" alt="" coords="849,380,938,407"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ac51a47d75843a542182cb6c2e997c67a_icgraph.png" border="0" usemap="#cube_8c_ac51a47d75843a542182cb6c2e997c67a_icgraph" alt=""/></div>
<map name="cube_8c_ac51a47d75843a542182cb6c2e997c67a_icgraph" id="cube_8c_ac51a47d75843a542182cb6c2e997c67a_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="149,144,276,171"/>
<area shape="rect" id="node4" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="527,119,615,145"/>
<area shape="rect" id="node5" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="913,93,1060,120"/>
<area shape="rect" id="node8" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="789,43,865,69"/>
<area shape="rect" id="node3" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="324,144,479,171"/>
<area shape="rect" id="node7" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="663,144,741,171"/>
<area shape="rect" id="node6" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1108,144,1181,171"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a8fb1a4c54cb4307dda563a41fb31459b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_run </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l02344">2344</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00433">demo::curFrame</a>, <a class="el" href="cube_8c_source.html#l01003">demo_draw()</a>, <a class="el" href="cube_8c_source.html#l00434">demo::frameCount</a>, <a class="el" href="cube_8c_source.html#l00339">demo::prepared</a>, and <a class="el" href="cube_8c_source.html#l00174">validation_error</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02387">demo_create_window()</a>, <a class="el" href="cube_8c_source.html#l03702">WinMain()</a>, and <a class="el" href="cube_8c_source.html#l02355">WndProc()</a>.</p>
<div class="fragment"><div class="line"><a name="l02344"></a><span class="lineno"> 2344</span>&#160;                                        {</div><div class="line"><a name="l02345"></a><span class="lineno"> 2345</span>&#160;    <span class="keywordflow">if</span> (!demo-&gt;<a class="code" href="structdemo.html#a37de313a90cfadb40755d35e8d70f704">prepared</a>) <span class="keywordflow">return</span>;</div><div class="line"><a name="l02346"></a><span class="lineno"> 2346</span>&#160;</div><div class="line"><a name="l02347"></a><span class="lineno"> 2347</span>&#160;    <a class="code" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616">demo_draw</a>(demo);</div><div class="line"><a name="l02348"></a><span class="lineno"> 2348</span>&#160;    demo-&gt;<a class="code" href="structdemo.html#a801600c468658c9dc656ef904f429f15">curFrame</a>++;</div><div class="line"><a name="l02349"></a><span class="lineno"> 2349</span>&#160;    <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a0c9b20bd3ef8c984594686ba662a48b7">frameCount</a> != INT_MAX &amp;&amp; demo-&gt;<a class="code" href="structdemo.html#a801600c468658c9dc656ef904f429f15">curFrame</a> == demo-&gt;<a class="code" href="structdemo.html#a0c9b20bd3ef8c984594686ba662a48b7">frameCount</a>) {</div><div class="line"><a name="l02350"></a><span class="lineno"> 2350</span>&#160;        PostQuitMessage(<a class="code" href="cube_8c.html#aa2a7e938c1d845c6a71f43750db0fd07">validation_error</a>);</div><div class="line"><a name="l02351"></a><span class="lineno"> 2351</span>&#160;    }</div><div class="line"><a name="l02352"></a><span class="lineno"> 2352</span>&#160;}</div><div class="ttc" id="structdemo_html_a37de313a90cfadb40755d35e8d70f704"><div class="ttname"><a href="structdemo.html#a37de313a90cfadb40755d35e8d70f704">demo::prepared</a></div><div class="ttdeci">bool prepared</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00339">cube.c:339</a></div></div>
<div class="ttc" id="cube_8c_html_aa2a7e938c1d845c6a71f43750db0fd07"><div class="ttname"><a href="cube_8c.html#aa2a7e938c1d845c6a71f43750db0fd07">validation_error</a></div><div class="ttdeci">static int validation_error</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00174">cube.c:174</a></div></div>
<div class="ttc" id="structdemo_html_a801600c468658c9dc656ef904f429f15"><div class="ttname"><a href="structdemo.html#a801600c468658c9dc656ef904f429f15">demo::curFrame</a></div><div class="ttdeci">int32_t curFrame</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00433">cube.c:433</a></div></div>
<div class="ttc" id="structdemo_html_a0c9b20bd3ef8c984594686ba662a48b7"><div class="ttname"><a href="structdemo.html#a0c9b20bd3ef8c984594686ba662a48b7">demo::frameCount</a></div><div class="ttdeci">int32_t frameCount</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00434">cube.c:434</a></div></div>
<div class="ttc" id="cube_8c_html_a68587107d1c17fe6680e438488b9a616"><div class="ttname"><a href="cube_8c.html#a68587107d1c17fe6680e438488b9a616">demo_draw</a></div><div class="ttdeci">static void demo_draw(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l01003">cube.c:1003</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a8fb1a4c54cb4307dda563a41fb31459b_cgraph.png" border="0" usemap="#cube_8c_a8fb1a4c54cb4307dda563a41fb31459b_cgraph" alt=""/></div>
<map name="cube_8c_a8fb1a4c54cb4307dda563a41fb31459b_cgraph" id="cube_8c_a8fb1a4c54cb4307dda563a41fb31459b_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="132,376,220,403"/>
<area shape="rect" id="node3" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="661,351,757,377"/>
<area shape="rect" id="node26" href="cube_8c.html#a2967b050fc63b30dc0cf382fbcf8f3c6" title="demo_update_data_buffer" alt="" coords="268,427,439,453"/>
<area shape="rect" id="node27" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="276,376,431,403"/>
<area shape="rect" id="node4" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="805,351,909,377"/>
<area shape="rect" id="node5" href="cube_8c.html#ad1571a7e9407fa30327f858d07ea6702" title="demo_build_image_ownership_cmd" alt="" coords="957,5,1184,32"/>
<area shape="rect" id="node6" href="cube_8c.html#a10612fc5c33836b531554ee572b389f2" title="demo_destroy_texture\l_image" alt="" coords="995,57,1146,98"/>
<area shape="rect" id="node7" href="cube_8c.html#aa9f275ddb85f8473f44c01a00ccfba63" title="demo_draw_build_cmd" alt="" coords="993,123,1148,149"/>
<area shape="rect" id="node8" href="cube_8c.html#a7a35f4639d32b3ac59dd725668a363ba" title="demo_flush_init_cmd" alt="" coords="999,173,1143,200"/>
<area shape="rect" id="node9" href="cube_8c.html#a0c4cc92dc1a3456d6cca76e3187f2010" title="demo_prepare_buffers" alt="" coords="996,224,1145,251"/>
<area shape="rect" id="node10" href="cube_8c.html#a21da8dc23d75bc75b5dbe7dd01130739" title="demo_prepare_cube_data\l_buffers" alt="" coords="1232,255,1403,297"/>
<area shape="rect" id="node12" href="cube_8c.html#a3569c83afeb4ecc4d8d797af29ce89ed" title="demo_prepare_depth" alt="" coords="1246,321,1389,348"/>
<area shape="rect" id="node13" href="cube_8c.html#a36308c10e305d94d63e96fc82be78950" title="demo_prepare_descriptor\l_layout" alt="" coords="987,427,1155,469"/>
<area shape="rect" id="node14" href="cube_8c.html#a4ee7f5efc65c5972db015c6be8cda380" title="demo_prepare_descriptor_pool" alt="" coords="971,493,1170,520"/>
<area shape="rect" id="node15" href="cube_8c.html#ac1957f225fabd1755a0064169fa5f6ba" title="demo_prepare_descriptor_set" alt="" coords="974,544,1167,571"/>
<area shape="rect" id="node16" href="cube_8c.html#a3a72610dc44a370494307b568ef3abd6" title="demo_prepare_framebuffers" alt="" coords="980,595,1161,621"/>
<area shape="rect" id="node17" href="cube_8c.html#aa80cd8877b6b5d20217c451b207ca9d9" title="demo_prepare_pipeline" alt="" coords="993,645,1148,672"/>
<area shape="rect" id="node21" href="cube_8c.html#a4ac6098487e1fc2305847f666891cdec" title="demo_prepare_render_pass" alt="" coords="979,696,1162,723"/>
<area shape="rect" id="node22" href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7" title="demo_prepare_textures" alt="" coords="991,376,1150,403"/>
<area shape="rect" id="node11" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b" title="memory_type_from_properties" alt="" coords="1451,321,1648,348"/>
<area shape="rect" id="node18" href="cube_8c.html#ab89d9436b88fd3dea5de8cb03de51e94" title="demo_prepare_fs" alt="" coords="1257,620,1378,647"/>
<area shape="rect" id="node20" href="cube_8c.html#ab1d134177a8964ce85593b229fc7f688" title="demo_prepare_vs" alt="" coords="1256,671,1379,697"/>
<area shape="rect" id="node19" href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c" title="demo_prepare_shader\l_module" alt="" coords="1474,638,1625,679"/>
<area shape="rect" id="node23" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731" title="demo_prepare_texture\l_image" alt="" coords="1242,373,1393,414"/>
<area shape="rect" id="node25" href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8" title="demo_set_image_layout" alt="" coords="1236,439,1399,465"/>
<area shape="rect" id="node24" href="cube_8c.html#add4fd1e03edd51503c9c554e77a042fa" title="loadTexture" alt="" coords="1505,380,1594,407"/>
<area shape="rect" id="node28" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="487,376,613,403"/>
<area shape="rect" id="node29" href="cube_8c.html#ab9ca7a0a208ec589229116f2de6ee77c" title="ActualTimeLate" alt="" coords="494,427,606,453"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a8fb1a4c54cb4307dda563a41fb31459b_icgraph.png" border="0" usemap="#cube_8c_a8fb1a4c54cb4307dda563a41fb31459b_icgraph" alt=""/></div>
<map name="cube_8c_a8fb1a4c54cb4307dda563a41fb31459b_icgraph" id="cube_8c_a8fb1a4c54cb4307dda563a41fb31459b_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="256,20,403,47"/>
<area shape="rect" id="node3" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="451,45,524,72"/>
<area shape="rect" id="node4" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="132,20,208,47"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="aba0ddac08f75117254d652598aeb72f8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void demo_set_image_layout </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VkImage&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VkImageAspectFlags&#160;</td>
          <td class="paramname"><em>aspectMask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VkImageLayout&#160;</td>
          <td class="paramname"><em>old_image_layout</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VkImageLayout&#160;</td>
          <td class="paramname"><em>new_image_layout</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VkAccessFlagBits&#160;</td>
          <td class="paramname"><em>srcAccessMask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VkPipelineStageFlags&#160;</td>
          <td class="paramname"><em>src_stages</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VkPipelineStageFlags&#160;</td>
          <td class="paramname"><em>dest_stages</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00651">651</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00412">demo::cmd</a>, and <a class="el" href="cube_8c_source.html#l00163">texture_object::image</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l01574">demo_prepare_textures()</a>.</p>
<div class="fragment"><div class="line"><a name="l00653"></a><span class="lineno">  653</span>&#160;                                                                    {</div><div class="line"><a name="l00654"></a><span class="lineno">  654</span>&#160;    assert(demo-&gt;<a class="code" href="structdemo.html#a5f52e6ec2780b7c5395983efe51bcb34">cmd</a>);</div><div class="line"><a name="l00655"></a><span class="lineno">  655</span>&#160;</div><div class="line"><a name="l00656"></a><span class="lineno">  656</span>&#160;    VkImageMemoryBarrier image_memory_barrier = {.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,</div><div class="line"><a name="l00657"></a><span class="lineno">  657</span>&#160;                                                 .pNext = NULL,</div><div class="line"><a name="l00658"></a><span class="lineno">  658</span>&#160;                                                 .srcAccessMask = srcAccessMask,</div><div class="line"><a name="l00659"></a><span class="lineno">  659</span>&#160;                                                 .dstAccessMask = 0,</div><div class="line"><a name="l00660"></a><span class="lineno">  660</span>&#160;                                                 .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,</div><div class="line"><a name="l00661"></a><span class="lineno">  661</span>&#160;                                                 .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,</div><div class="line"><a name="l00662"></a><span class="lineno">  662</span>&#160;                                                 .oldLayout = old_image_layout,</div><div class="line"><a name="l00663"></a><span class="lineno">  663</span>&#160;                                                 .newLayout = new_image_layout,</div><div class="line"><a name="l00664"></a><span class="lineno">  664</span>&#160;                                                 .image = image,</div><div class="line"><a name="l00665"></a><span class="lineno">  665</span>&#160;                                                 .subresourceRange = {aspectMask, 0, 1, 0, 1}};</div><div class="line"><a name="l00666"></a><span class="lineno">  666</span>&#160;</div><div class="line"><a name="l00667"></a><span class="lineno">  667</span>&#160;    <span class="keywordflow">switch</span> (new_image_layout) {</div><div class="line"><a name="l00668"></a><span class="lineno">  668</span>&#160;        <span class="keywordflow">case</span> VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL:</div><div class="line"><a name="l00669"></a><span class="lineno">  669</span>&#160;            <span class="comment">/* Make sure anything that was copying from this image has completed */</span></div><div class="line"><a name="l00670"></a><span class="lineno">  670</span>&#160;            image_memory_barrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;</div><div class="line"><a name="l00671"></a><span class="lineno">  671</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00672"></a><span class="lineno">  672</span>&#160;</div><div class="line"><a name="l00673"></a><span class="lineno">  673</span>&#160;        <span class="keywordflow">case</span> VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL:</div><div class="line"><a name="l00674"></a><span class="lineno">  674</span>&#160;            image_memory_barrier.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;</div><div class="line"><a name="l00675"></a><span class="lineno">  675</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00676"></a><span class="lineno">  676</span>&#160;</div><div class="line"><a name="l00677"></a><span class="lineno">  677</span>&#160;        <span class="keywordflow">case</span> VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL:</div><div class="line"><a name="l00678"></a><span class="lineno">  678</span>&#160;            image_memory_barrier.dstAccessMask = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;</div><div class="line"><a name="l00679"></a><span class="lineno">  679</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00680"></a><span class="lineno">  680</span>&#160;</div><div class="line"><a name="l00681"></a><span class="lineno">  681</span>&#160;        <span class="keywordflow">case</span> VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:</div><div class="line"><a name="l00682"></a><span class="lineno">  682</span>&#160;            image_memory_barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_INPUT_ATTACHMENT_READ_BIT;</div><div class="line"><a name="l00683"></a><span class="lineno">  683</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00684"></a><span class="lineno">  684</span>&#160;</div><div class="line"><a name="l00685"></a><span class="lineno">  685</span>&#160;        <span class="keywordflow">case</span> VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL:</div><div class="line"><a name="l00686"></a><span class="lineno">  686</span>&#160;            image_memory_barrier.dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT;</div><div class="line"><a name="l00687"></a><span class="lineno">  687</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00688"></a><span class="lineno">  688</span>&#160;</div><div class="line"><a name="l00689"></a><span class="lineno">  689</span>&#160;        <span class="keywordflow">case</span> VK_IMAGE_LAYOUT_PRESENT_SRC_KHR:</div><div class="line"><a name="l00690"></a><span class="lineno">  690</span>&#160;            image_memory_barrier.dstAccessMask = VK_ACCESS_MEMORY_READ_BIT;</div><div class="line"><a name="l00691"></a><span class="lineno">  691</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00692"></a><span class="lineno">  692</span>&#160;</div><div class="line"><a name="l00693"></a><span class="lineno">  693</span>&#160;        <span class="keywordflow">default</span>:</div><div class="line"><a name="l00694"></a><span class="lineno">  694</span>&#160;            image_memory_barrier.dstAccessMask = 0;</div><div class="line"><a name="l00695"></a><span class="lineno">  695</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00696"></a><span class="lineno">  696</span>&#160;    }</div><div class="line"><a name="l00697"></a><span class="lineno">  697</span>&#160;</div><div class="line"><a name="l00698"></a><span class="lineno">  698</span>&#160;    VkImageMemoryBarrier *pmemory_barrier = &amp;image_memory_barrier;</div><div class="line"><a name="l00699"></a><span class="lineno">  699</span>&#160;</div><div class="line"><a name="l00700"></a><span class="lineno">  700</span>&#160;    vkCmdPipelineBarrier(demo-&gt;<a class="code" href="structdemo.html#a5f52e6ec2780b7c5395983efe51bcb34">cmd</a>, src_stages, dest_stages, 0, 0, NULL, 0, NULL, 1, pmemory_barrier);</div><div class="line"><a name="l00701"></a><span class="lineno">  701</span>&#160;}</div><div class="ttc" id="structdemo_html_a5f52e6ec2780b7c5395983efe51bcb34"><div class="ttname"><a href="structdemo.html#a5f52e6ec2780b7c5395983efe51bcb34">demo::cmd</a></div><div class="ttdeci">VkCommandBuffer cmd</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00412">cube.c:412</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_aba0ddac08f75117254d652598aeb72f8_icgraph.png" border="0" usemap="#cube_8c_aba0ddac08f75117254d652598aeb72f8_icgraph" alt=""/></div>
<map name="cube_8c_aba0ddac08f75117254d652598aeb72f8_icgraph" id="cube_8c_aba0ddac08f75117254d652598aeb72f8_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7" title="demo_prepare_textures" alt="" coords="216,43,375,69"/>
<area shape="rect" id="node3" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="423,43,527,69"/>
<area shape="rect" id="node4" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="575,93,671,120"/>
<area shape="rect" id="node9" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1677,119,1751,145"/>
<area shape="rect" id="node5" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="719,93,845,120"/>
<area shape="rect" id="node7" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="1096,119,1184,145"/>
<area shape="rect" id="node8" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1483,119,1629,145"/>
<area shape="rect" id="node11" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1359,245,1435,272"/>
<area shape="rect" id="node6" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="893,93,1048,120"/>
<area shape="rect" id="node10" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1232,156,1311,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a2967b050fc63b30dc0cf382fbcf8f3c6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void demo_update_data_buffer </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00865">865</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00449">demo::current_buffer</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00421">demo::model_matrix</a>, <a class="el" href="cube_8c_source.html#l00419">demo::projection_matrix</a>, <a class="el" href="cube_8c_source.html#l00423">demo::spin_angle</a>, <a class="el" href="cube_8c_source.html#l00392">demo::swapchain_image_resources</a>, <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>, <a class="el" href="cube_8c_source.html#l00300">SwapchainImageResources::uniform_memory</a>, and <a class="el" href="cube_8c_source.html#l00420">demo::view_matrix</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l01003">demo_draw()</a>.</p>
<div class="fragment"><div class="line"><a name="l00865"></a><span class="lineno">  865</span>&#160;                                                {</div><div class="line"><a name="l00866"></a><span class="lineno">  866</span>&#160;    mat4x4 MVP, Model, VP;</div><div class="line"><a name="l00867"></a><span class="lineno">  867</span>&#160;    <span class="keywordtype">int</span> matrixSize = <span class="keyword">sizeof</span>(MVP);</div><div class="line"><a name="l00868"></a><span class="lineno">  868</span>&#160;    uint8_t *pData;</div><div class="line"><a name="l00869"></a><span class="lineno">  869</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l00870"></a><span class="lineno">  870</span>&#160;</div><div class="line"><a name="l00871"></a><span class="lineno">  871</span>&#160;    mat4x4_mul(VP, demo-&gt;<a class="code" href="structdemo.html#aaedd749233b7ac4c3995f57ed2661760">projection_matrix</a>, demo-&gt;<a class="code" href="structdemo.html#a48dbc591ffcf6b9ee0d8da7601221b46">view_matrix</a>);</div><div class="line"><a name="l00872"></a><span class="lineno">  872</span>&#160;</div><div class="line"><a name="l00873"></a><span class="lineno">  873</span>&#160;    <span class="comment">// Rotate around the Y axis</span></div><div class="line"><a name="l00874"></a><span class="lineno">  874</span>&#160;    mat4x4_dup(Model, demo-&gt;<a class="code" href="structdemo.html#ae7f8cd202364dbe492a9bdb47e52c6d6">model_matrix</a>);</div><div class="line"><a name="l00875"></a><span class="lineno">  875</span>&#160;    mat4x4_rotate(demo-&gt;<a class="code" href="structdemo.html#ae7f8cd202364dbe492a9bdb47e52c6d6">model_matrix</a>, Model, 0.0f, 1.0f, 0.0f, (<span class="keywordtype">float</span>)degreesToRadians(demo-&gt;<a class="code" href="structdemo.html#a864cd80008ffc0cff93395d67a77fc61">spin_angle</a>));</div><div class="line"><a name="l00876"></a><span class="lineno">  876</span>&#160;    mat4x4_mul(MVP, VP, demo-&gt;<a class="code" href="structdemo.html#ae7f8cd202364dbe492a9bdb47e52c6d6">model_matrix</a>);</div><div class="line"><a name="l00877"></a><span class="lineno">  877</span>&#160;</div><div class="line"><a name="l00878"></a><span class="lineno">  878</span>&#160;    err = vkMapMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[demo-&gt;<a class="code" href="structdemo.html#a8ef0be14f77810d25d103241361daa30">current_buffer</a>].<a class="code" href="struct_swapchain_image_resources.html#a2e342d29ed730c31f00de806b8bfb4b2">uniform_memory</a>, 0, VK_WHOLE_SIZE, 0,</div><div class="line"><a name="l00879"></a><span class="lineno">  879</span>&#160;                      (<span class="keywordtype">void</span> **)&amp;pData);</div><div class="line"><a name="l00880"></a><span class="lineno">  880</span>&#160;    assert(!err);</div><div class="line"><a name="l00881"></a><span class="lineno">  881</span>&#160;</div><div class="line"><a name="l00882"></a><span class="lineno">  882</span>&#160;    memcpy(pData, (<span class="keyword">const</span> <span class="keywordtype">void</span> *)&amp;MVP[0][0], matrixSize);</div><div class="line"><a name="l00883"></a><span class="lineno">  883</span>&#160;</div><div class="line"><a name="l00884"></a><span class="lineno">  884</span>&#160;    vkUnmapMemory(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">swapchain_image_resources</a>[demo-&gt;<a class="code" href="structdemo.html#a8ef0be14f77810d25d103241361daa30">current_buffer</a>].<a class="code" href="struct_swapchain_image_resources.html#a2e342d29ed730c31f00de806b8bfb4b2">uniform_memory</a>);</div><div class="line"><a name="l00885"></a><span class="lineno">  885</span>&#160;}</div><div class="ttc" id="structdemo_html_a48dbc591ffcf6b9ee0d8da7601221b46"><div class="ttname"><a href="structdemo.html#a48dbc591ffcf6b9ee0d8da7601221b46">demo::view_matrix</a></div><div class="ttdeci">mat4x4 view_matrix</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00420">cube.c:420</a></div></div>
<div class="ttc" id="structdemo_html_a139cab94cb0a578562759d7f315ca0b5"><div class="ttname"><a href="structdemo.html#a139cab94cb0a578562759d7f315ca0b5">demo::swapchain_image_resources</a></div><div class="ttdeci">SwapchainImageResources * swapchain_image_resources</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00392">cube.c:392</a></div></div>
<div class="ttc" id="struct_swapchain_image_resources_html_a2e342d29ed730c31f00de806b8bfb4b2"><div class="ttname"><a href="struct_swapchain_image_resources.html#a2e342d29ed730c31f00de806b8bfb4b2">SwapchainImageResources::uniform_memory</a></div><div class="ttdeci">VkDeviceMemory uniform_memory</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00300">cube.c:300</a></div></div>
<div class="ttc" id="structdemo_html_aaedd749233b7ac4c3995f57ed2661760"><div class="ttname"><a href="structdemo.html#aaedd749233b7ac4c3995f57ed2661760">demo::projection_matrix</a></div><div class="ttdeci">mat4x4 projection_matrix</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00419">cube.c:419</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_a864cd80008ffc0cff93395d67a77fc61"><div class="ttname"><a href="structdemo.html#a864cd80008ffc0cff93395d67a77fc61">demo::spin_angle</a></div><div class="ttdeci">float spin_angle</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00423">cube.c:423</a></div></div>
<div class="ttc" id="structdemo_html_ae7f8cd202364dbe492a9bdb47e52c6d6"><div class="ttname"><a href="structdemo.html#ae7f8cd202364dbe492a9bdb47e52c6d6">demo::model_matrix</a></div><div class="ttdeci">mat4x4 model_matrix</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00421">cube.c:421</a></div></div>
<div class="ttc" id="structdemo_html_a8ef0be14f77810d25d103241361daa30"><div class="ttname"><a href="structdemo.html#a8ef0be14f77810d25d103241361daa30">demo::current_buffer</a></div><div class="ttdeci">uint32_t current_buffer</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00449">cube.c:449</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a2967b050fc63b30dc0cf382fbcf8f3c6_icgraph.png" border="0" usemap="#cube_8c_a2967b050fc63b30dc0cf382fbcf8f3c6_icgraph" alt=""/></div>
<map name="cube_8c_a2967b050fc63b30dc0cf382fbcf8f3c6_icgraph" id="cube_8c_a2967b050fc63b30dc0cf382fbcf8f3c6_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="224,5,312,32"/>
<area shape="rect" id="node3" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="611,56,757,83"/>
<area shape="rect" id="node5" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="360,56,439,83"/>
<area shape="rect" id="node4" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="805,95,879,121"/>
<area shape="rect" id="node6" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="487,81,563,108"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a004704ce51b4b63b3d59eef1d5ea2cee"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void DemoUpdateTargetIPD </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00887">887</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00561">ActualTimeLate()</a>, <a class="el" href="cube_8c_source.html#l00064">BILLION</a>, <a class="el" href="cube_8c_source.html#l00579">CanPresentEarlier()</a>, <a class="el" href="cube_8c_source.html#l00358">demo::device</a>, <a class="el" href="cube_8c_source.html#l00389">demo::fpGetPastPresentationTimingGOOGLE</a>, <a class="el" href="cube_8c_source.html#l00353">demo::last_early_id</a>, <a class="el" href="cube_8c_source.html#l00354">demo::last_late_id</a>, <a class="el" href="cube_8c_source.html#l00352">demo::next_present_id</a>, <a class="el" href="cube_8c_source.html#l00351">demo::prev_desired_present_time</a>, <a class="el" href="cube_8c_source.html#l00348">demo::refresh_duration</a>, <a class="el" href="cube_8c_source.html#l00349">demo::refresh_duration_multiplier</a>, <a class="el" href="cube_8c_source.html#l00391">demo::swapchain</a>, <a class="el" href="cube_8c_source.html#l00347">demo::syncd_with_actual_presents</a>, <a class="el" href="cube_8c_source.html#l00350">demo::target_IPD</a>, and <a class="el" href="cube_8c_source.html#l00078">U_ASSERT_ONLY</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l01003">demo_draw()</a>.</p>
<div class="fragment"><div class="line"><a name="l00887"></a><span class="lineno">  887</span>&#160;                                            {</div><div class="line"><a name="l00888"></a><span class="lineno">  888</span>&#160;    <span class="comment">// Look at what happened to previous presents, and make appropriate</span></div><div class="line"><a name="l00889"></a><span class="lineno">  889</span>&#160;    <span class="comment">// adjustments in timing:</span></div><div class="line"><a name="l00890"></a><span class="lineno">  890</span>&#160;    VkResult <a class="code" href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a> err;</div><div class="line"><a name="l00891"></a><span class="lineno">  891</span>&#160;    VkPastPresentationTimingGOOGLE *past = NULL;</div><div class="line"><a name="l00892"></a><span class="lineno">  892</span>&#160;    uint32_t count = 0;</div><div class="line"><a name="l00893"></a><span class="lineno">  893</span>&#160;</div><div class="line"><a name="l00894"></a><span class="lineno">  894</span>&#160;    err = demo-&gt;<a class="code" href="structdemo.html#affe3d21204d2084cc74cb25062cd1420">fpGetPastPresentationTimingGOOGLE</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a29b10893f1569e17a99027963c2fed3b">swapchain</a>, &amp;count, NULL);</div><div class="line"><a name="l00895"></a><span class="lineno">  895</span>&#160;    assert(!err);</div><div class="line"><a name="l00896"></a><span class="lineno">  896</span>&#160;    <span class="keywordflow">if</span> (count) {</div><div class="line"><a name="l00897"></a><span class="lineno">  897</span>&#160;        past = (VkPastPresentationTimingGOOGLE *)malloc(<span class="keyword">sizeof</span>(VkPastPresentationTimingGOOGLE) * count);</div><div class="line"><a name="l00898"></a><span class="lineno">  898</span>&#160;        assert(past);</div><div class="line"><a name="l00899"></a><span class="lineno">  899</span>&#160;        err = demo-&gt;<a class="code" href="structdemo.html#affe3d21204d2084cc74cb25062cd1420">fpGetPastPresentationTimingGOOGLE</a>(demo-&gt;<a class="code" href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">device</a>, demo-&gt;<a class="code" href="structdemo.html#a29b10893f1569e17a99027963c2fed3b">swapchain</a>, &amp;count, past);</div><div class="line"><a name="l00900"></a><span class="lineno">  900</span>&#160;        assert(!err);</div><div class="line"><a name="l00901"></a><span class="lineno">  901</span>&#160;</div><div class="line"><a name="l00902"></a><span class="lineno">  902</span>&#160;        <span class="keywordtype">bool</span> early = <span class="keyword">false</span>;</div><div class="line"><a name="l00903"></a><span class="lineno">  903</span>&#160;        <span class="keywordtype">bool</span> late = <span class="keyword">false</span>;</div><div class="line"><a name="l00904"></a><span class="lineno">  904</span>&#160;        <span class="keywordtype">bool</span> calibrate_next = <span class="keyword">false</span>;</div><div class="line"><a name="l00905"></a><span class="lineno">  905</span>&#160;        <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; count; i++) {</div><div class="line"><a name="l00906"></a><span class="lineno">  906</span>&#160;            <span class="keywordflow">if</span> (!demo-&gt;<a class="code" href="structdemo.html#a9bd68668039ac7d6230373ac6d62cc70">syncd_with_actual_presents</a>) {</div><div class="line"><a name="l00907"></a><span class="lineno">  907</span>&#160;                <span class="comment">// This is the first time that we&#39;ve received an</span></div><div class="line"><a name="l00908"></a><span class="lineno">  908</span>&#160;                <span class="comment">// actualPresentTime for this swapchain.  In order to not</span></div><div class="line"><a name="l00909"></a><span class="lineno">  909</span>&#160;                <span class="comment">// perceive these early frames as &quot;late&quot;, we need to sync-up</span></div><div class="line"><a name="l00910"></a><span class="lineno">  910</span>&#160;                <span class="comment">// our future desiredPresentTime&#39;s with the</span></div><div class="line"><a name="l00911"></a><span class="lineno">  911</span>&#160;                <span class="comment">// actualPresentTime(s) that we&#39;re receiving now.</span></div><div class="line"><a name="l00912"></a><span class="lineno">  912</span>&#160;                calibrate_next = <span class="keyword">true</span>;</div><div class="line"><a name="l00913"></a><span class="lineno">  913</span>&#160;</div><div class="line"><a name="l00914"></a><span class="lineno">  914</span>&#160;                <span class="comment">// So that we don&#39;t suspect any pending presents as late,</span></div><div class="line"><a name="l00915"></a><span class="lineno">  915</span>&#160;                <span class="comment">// record them all as suspected-late presents:</span></div><div class="line"><a name="l00916"></a><span class="lineno">  916</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a0beb24076411cc1d02c7dcfcedf0f7c3">last_late_id</a> = demo-&gt;<a class="code" href="structdemo.html#a316d35245b2cbcfb681c24a5c8b0ca9b">next_present_id</a> - 1;</div><div class="line"><a name="l00917"></a><span class="lineno">  917</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#acf9411bc54c997058638b2ff7f9f8515">last_early_id</a> = 0;</div><div class="line"><a name="l00918"></a><span class="lineno">  918</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a9bd68668039ac7d6230373ac6d62cc70">syncd_with_actual_presents</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l00919"></a><span class="lineno">  919</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l00920"></a><span class="lineno">  920</span>&#160;            } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca">CanPresentEarlier</a>(past[i].earliestPresentTime, past[i].actualPresentTime, past[i].presentMargin,</div><div class="line"><a name="l00921"></a><span class="lineno">  921</span>&#160;                                         demo-&gt;<a class="code" href="structdemo.html#a1311039938bb87188def4bc76ddb2948">refresh_duration</a>)) {</div><div class="line"><a name="l00922"></a><span class="lineno">  922</span>&#160;                <span class="comment">// This image could have been presented earlier.  We don&#39;t want</span></div><div class="line"><a name="l00923"></a><span class="lineno">  923</span>&#160;                <span class="comment">// to decrease the target_IPD until we&#39;ve seen early presents</span></div><div class="line"><a name="l00924"></a><span class="lineno">  924</span>&#160;                <span class="comment">// for at least two seconds.</span></div><div class="line"><a name="l00925"></a><span class="lineno">  925</span>&#160;                <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#acf9411bc54c997058638b2ff7f9f8515">last_early_id</a> == past[i].presentID) {</div><div class="line"><a name="l00926"></a><span class="lineno">  926</span>&#160;                    <span class="comment">// We&#39;ve now seen two seconds worth of early presents.</span></div><div class="line"><a name="l00927"></a><span class="lineno">  927</span>&#160;                    <span class="comment">// Flag it as such, and reset the counter:</span></div><div class="line"><a name="l00928"></a><span class="lineno">  928</span>&#160;                    early = <span class="keyword">true</span>;</div><div class="line"><a name="l00929"></a><span class="lineno">  929</span>&#160;                    demo-&gt;<a class="code" href="structdemo.html#acf9411bc54c997058638b2ff7f9f8515">last_early_id</a> = 0;</div><div class="line"><a name="l00930"></a><span class="lineno">  930</span>&#160;                } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#acf9411bc54c997058638b2ff7f9f8515">last_early_id</a> == 0) {</div><div class="line"><a name="l00931"></a><span class="lineno">  931</span>&#160;                    <span class="comment">// This is the first early present we&#39;ve seen.</span></div><div class="line"><a name="l00932"></a><span class="lineno">  932</span>&#160;                    <span class="comment">// Calculate the presentID for two seconds from now.</span></div><div class="line"><a name="l00933"></a><span class="lineno">  933</span>&#160;                    uint64_t lastEarlyTime = past[i].actualPresentTime + (2 * <a class="code" href="cube_8c.html#a31f99d9c502b52b5f36dc7e2028c2e80">BILLION</a>);</div><div class="line"><a name="l00934"></a><span class="lineno">  934</span>&#160;                    uint32_t howManyPresents = (uint32_t)((lastEarlyTime - past[i].actualPresentTime) / demo-&gt;<a class="code" href="structdemo.html#a6565c3c9d86ea398f943fd3f9cf7be46">target_IPD</a>);</div><div class="line"><a name="l00935"></a><span class="lineno">  935</span>&#160;                    demo-&gt;<a class="code" href="structdemo.html#acf9411bc54c997058638b2ff7f9f8515">last_early_id</a> = past[i].presentID + howManyPresents;</div><div class="line"><a name="l00936"></a><span class="lineno">  936</span>&#160;                } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00937"></a><span class="lineno">  937</span>&#160;                    <span class="comment">// We are in the midst of a set of early images,</span></div><div class="line"><a name="l00938"></a><span class="lineno">  938</span>&#160;                    <span class="comment">// and so we won&#39;t do anything.</span></div><div class="line"><a name="l00939"></a><span class="lineno">  939</span>&#160;                }</div><div class="line"><a name="l00940"></a><span class="lineno">  940</span>&#160;                late = <span class="keyword">false</span>;</div><div class="line"><a name="l00941"></a><span class="lineno">  941</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a0beb24076411cc1d02c7dcfcedf0f7c3">last_late_id</a> = 0;</div><div class="line"><a name="l00942"></a><span class="lineno">  942</span>&#160;            } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="cube_8c.html#ab9ca7a0a208ec589229116f2de6ee77c">ActualTimeLate</a>(past[i].desiredPresentTime, past[i].actualPresentTime, demo-&gt;<a class="code" href="structdemo.html#a1311039938bb87188def4bc76ddb2948">refresh_duration</a>)) {</div><div class="line"><a name="l00943"></a><span class="lineno">  943</span>&#160;                <span class="comment">// This image was presented after its desired time.  Since</span></div><div class="line"><a name="l00944"></a><span class="lineno">  944</span>&#160;                <span class="comment">// there&#39;s a delay between calling vkQueuePresentKHR and when</span></div><div class="line"><a name="l00945"></a><span class="lineno">  945</span>&#160;                <span class="comment">// we get the timing data, several presents may have been late.</span></div><div class="line"><a name="l00946"></a><span class="lineno">  946</span>&#160;                <span class="comment">// Thus, we need to threat all of the outstanding presents as</span></div><div class="line"><a name="l00947"></a><span class="lineno">  947</span>&#160;                <span class="comment">// being likely late, so that we only increase the target_IPD</span></div><div class="line"><a name="l00948"></a><span class="lineno">  948</span>&#160;                <span class="comment">// once for all of those presents.</span></div><div class="line"><a name="l00949"></a><span class="lineno">  949</span>&#160;                <span class="keywordflow">if</span> ((demo-&gt;<a class="code" href="structdemo.html#a0beb24076411cc1d02c7dcfcedf0f7c3">last_late_id</a> == 0) || (demo-&gt;<a class="code" href="structdemo.html#a0beb24076411cc1d02c7dcfcedf0f7c3">last_late_id</a> &lt; past[i].presentID)) {</div><div class="line"><a name="l00950"></a><span class="lineno">  950</span>&#160;                    late = <span class="keyword">true</span>;</div><div class="line"><a name="l00951"></a><span class="lineno">  951</span>&#160;                    <span class="comment">// Record the last suspected-late present:</span></div><div class="line"><a name="l00952"></a><span class="lineno">  952</span>&#160;                    demo-&gt;<a class="code" href="structdemo.html#a0beb24076411cc1d02c7dcfcedf0f7c3">last_late_id</a> = demo-&gt;<a class="code" href="structdemo.html#a316d35245b2cbcfb681c24a5c8b0ca9b">next_present_id</a> - 1;</div><div class="line"><a name="l00953"></a><span class="lineno">  953</span>&#160;                } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00954"></a><span class="lineno">  954</span>&#160;                    <span class="comment">// We are in the midst of a set of likely-late images,</span></div><div class="line"><a name="l00955"></a><span class="lineno">  955</span>&#160;                    <span class="comment">// and so we won&#39;t do anything.</span></div><div class="line"><a name="l00956"></a><span class="lineno">  956</span>&#160;                }</div><div class="line"><a name="l00957"></a><span class="lineno">  957</span>&#160;                early = <span class="keyword">false</span>;</div><div class="line"><a name="l00958"></a><span class="lineno">  958</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#acf9411bc54c997058638b2ff7f9f8515">last_early_id</a> = 0;</div><div class="line"><a name="l00959"></a><span class="lineno">  959</span>&#160;            } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00960"></a><span class="lineno">  960</span>&#160;                <span class="comment">// Since this image was not presented early or late, reset</span></div><div class="line"><a name="l00961"></a><span class="lineno">  961</span>&#160;                <span class="comment">// any sets of early or late presentIDs:</span></div><div class="line"><a name="l00962"></a><span class="lineno">  962</span>&#160;                early = <span class="keyword">false</span>;</div><div class="line"><a name="l00963"></a><span class="lineno">  963</span>&#160;                late = <span class="keyword">false</span>;</div><div class="line"><a name="l00964"></a><span class="lineno">  964</span>&#160;                calibrate_next = <span class="keyword">true</span>;</div><div class="line"><a name="l00965"></a><span class="lineno">  965</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#acf9411bc54c997058638b2ff7f9f8515">last_early_id</a> = 0;</div><div class="line"><a name="l00966"></a><span class="lineno">  966</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a0beb24076411cc1d02c7dcfcedf0f7c3">last_late_id</a> = 0;</div><div class="line"><a name="l00967"></a><span class="lineno">  967</span>&#160;            }</div><div class="line"><a name="l00968"></a><span class="lineno">  968</span>&#160;        }</div><div class="line"><a name="l00969"></a><span class="lineno">  969</span>&#160;</div><div class="line"><a name="l00970"></a><span class="lineno">  970</span>&#160;        <span class="keywordflow">if</span> (early) {</div><div class="line"><a name="l00971"></a><span class="lineno">  971</span>&#160;            <span class="comment">// Since we&#39;ve seen at least two-seconds worth of presnts that</span></div><div class="line"><a name="l00972"></a><span class="lineno">  972</span>&#160;            <span class="comment">// could have occured earlier than desired, let&#39;s decrease the</span></div><div class="line"><a name="l00973"></a><span class="lineno">  973</span>&#160;            <span class="comment">// target_IPD (i.e. increase the frame rate):</span></div><div class="line"><a name="l00974"></a><span class="lineno">  974</span>&#160;            <span class="comment">//</span></div><div class="line"><a name="l00975"></a><span class="lineno">  975</span>&#160;            <span class="comment">// TODO(ianelliott): Try to calculate a better target_IPD based</span></div><div class="line"><a name="l00976"></a><span class="lineno">  976</span>&#160;            <span class="comment">// on the most recently-seen present (this is overly-simplistic).</span></div><div class="line"><a name="l00977"></a><span class="lineno">  977</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#a96fb9109cbd63ce7dffdcd45d63faef7">refresh_duration_multiplier</a>--;</div><div class="line"><a name="l00978"></a><span class="lineno">  978</span>&#160;            <span class="keywordflow">if</span> (demo-&gt;<a class="code" href="structdemo.html#a96fb9109cbd63ce7dffdcd45d63faef7">refresh_duration_multiplier</a> == 0) {</div><div class="line"><a name="l00979"></a><span class="lineno">  979</span>&#160;                <span class="comment">// This should never happen, but in case it does, don&#39;t</span></div><div class="line"><a name="l00980"></a><span class="lineno">  980</span>&#160;                <span class="comment">// try to go faster.</span></div><div class="line"><a name="l00981"></a><span class="lineno">  981</span>&#160;                demo-&gt;<a class="code" href="structdemo.html#a96fb9109cbd63ce7dffdcd45d63faef7">refresh_duration_multiplier</a> = 1;</div><div class="line"><a name="l00982"></a><span class="lineno">  982</span>&#160;            }</div><div class="line"><a name="l00983"></a><span class="lineno">  983</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#a6565c3c9d86ea398f943fd3f9cf7be46">target_IPD</a> = demo-&gt;<a class="code" href="structdemo.html#a1311039938bb87188def4bc76ddb2948">refresh_duration</a> * demo-&gt;<a class="code" href="structdemo.html#a96fb9109cbd63ce7dffdcd45d63faef7">refresh_duration_multiplier</a>;</div><div class="line"><a name="l00984"></a><span class="lineno">  984</span>&#160;        }</div><div class="line"><a name="l00985"></a><span class="lineno">  985</span>&#160;        <span class="keywordflow">if</span> (late) {</div><div class="line"><a name="l00986"></a><span class="lineno">  986</span>&#160;            <span class="comment">// Since we found a new instance of a late present, we want to</span></div><div class="line"><a name="l00987"></a><span class="lineno">  987</span>&#160;            <span class="comment">// increase the target_IPD (i.e. decrease the frame rate):</span></div><div class="line"><a name="l00988"></a><span class="lineno">  988</span>&#160;            <span class="comment">//</span></div><div class="line"><a name="l00989"></a><span class="lineno">  989</span>&#160;            <span class="comment">// TODO(ianelliott): Try to calculate a better target_IPD based</span></div><div class="line"><a name="l00990"></a><span class="lineno">  990</span>&#160;            <span class="comment">// on the most recently-seen present (this is overly-simplistic).</span></div><div class="line"><a name="l00991"></a><span class="lineno">  991</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#a96fb9109cbd63ce7dffdcd45d63faef7">refresh_duration_multiplier</a>++;</div><div class="line"><a name="l00992"></a><span class="lineno">  992</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#a6565c3c9d86ea398f943fd3f9cf7be46">target_IPD</a> = demo-&gt;<a class="code" href="structdemo.html#a1311039938bb87188def4bc76ddb2948">refresh_duration</a> * demo-&gt;<a class="code" href="structdemo.html#a96fb9109cbd63ce7dffdcd45d63faef7">refresh_duration_multiplier</a>;</div><div class="line"><a name="l00993"></a><span class="lineno">  993</span>&#160;        }</div><div class="line"><a name="l00994"></a><span class="lineno">  994</span>&#160;</div><div class="line"><a name="l00995"></a><span class="lineno">  995</span>&#160;        <span class="keywordflow">if</span> (calibrate_next) {</div><div class="line"><a name="l00996"></a><span class="lineno">  996</span>&#160;            int64_t multiple = demo-&gt;<a class="code" href="structdemo.html#a316d35245b2cbcfb681c24a5c8b0ca9b">next_present_id</a> - past[count - 1].presentID;</div><div class="line"><a name="l00997"></a><span class="lineno">  997</span>&#160;            demo-&gt;<a class="code" href="structdemo.html#a2a29d089e3aa3044b8aa9a42d0a696d3">prev_desired_present_time</a> = (past[count - 1].actualPresentTime + (multiple * demo-&gt;<a class="code" href="structdemo.html#a6565c3c9d86ea398f943fd3f9cf7be46">target_IPD</a>));</div><div class="line"><a name="l00998"></a><span class="lineno">  998</span>&#160;        }</div><div class="line"><a name="l00999"></a><span class="lineno">  999</span>&#160;        free(past);</div><div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>&#160;    }</div><div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>&#160;}</div><div class="ttc" id="structdemo_html_a2a29d089e3aa3044b8aa9a42d0a696d3"><div class="ttname"><a href="structdemo.html#a2a29d089e3aa3044b8aa9a42d0a696d3">demo::prev_desired_present_time</a></div><div class="ttdeci">uint64_t prev_desired_present_time</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00351">cube.c:351</a></div></div>
<div class="ttc" id="cube_8c_html_ab9ca7a0a208ec589229116f2de6ee77c"><div class="ttname"><a href="cube_8c.html#ab9ca7a0a208ec589229116f2de6ee77c">ActualTimeLate</a></div><div class="ttdeci">bool ActualTimeLate(uint64_t desired, uint64_t actual, uint64_t rdur)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00561">cube.c:561</a></div></div>
<div class="ttc" id="structdemo_html_a29b10893f1569e17a99027963c2fed3b"><div class="ttname"><a href="structdemo.html#a29b10893f1569e17a99027963c2fed3b">demo::swapchain</a></div><div class="ttdeci">VkSwapchainKHR swapchain</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00391">cube.c:391</a></div></div>
<div class="ttc" id="structdemo_html_a6565c3c9d86ea398f943fd3f9cf7be46"><div class="ttname"><a href="structdemo.html#a6565c3c9d86ea398f943fd3f9cf7be46">demo::target_IPD</a></div><div class="ttdeci">uint64_t target_IPD</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00350">cube.c:350</a></div></div>
<div class="ttc" id="structdemo_html_acf9411bc54c997058638b2ff7f9f8515"><div class="ttname"><a href="structdemo.html#acf9411bc54c997058638b2ff7f9f8515">demo::last_early_id</a></div><div class="ttdeci">uint32_t last_early_id</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00353">cube.c:353</a></div></div>
<div class="ttc" id="cube_8c_html_a31f99d9c502b52b5f36dc7e2028c2e80"><div class="ttname"><a href="cube_8c.html#a31f99d9c502b52b5f36dc7e2028c2e80">BILLION</a></div><div class="ttdeci">#define BILLION</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00064">cube.c:64</a></div></div>
<div class="ttc" id="cube_8c_html_aef0d76102bd69a61b3bc49beecae77ca"><div class="ttname"><a href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca">CanPresentEarlier</a></div><div class="ttdeci">bool CanPresentEarlier(uint64_t earliest, uint64_t actual, uint64_t margin, uint64_t rdur)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00579">cube.c:579</a></div></div>
<div class="ttc" id="structdemo_html_a316d35245b2cbcfb681c24a5c8b0ca9b"><div class="ttname"><a href="structdemo.html#a316d35245b2cbcfb681c24a5c8b0ca9b">demo::next_present_id</a></div><div class="ttdeci">uint32_t next_present_id</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00352">cube.c:352</a></div></div>
<div class="ttc" id="cube_8c_html_ab33dabc77056cb02bf8609c97d49716b"><div class="ttname"><a href="cube_8c.html#ab33dabc77056cb02bf8609c97d49716b">U_ASSERT_ONLY</a></div><div class="ttdeci">#define U_ASSERT_ONLY</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00078">cube.c:78</a></div></div>
<div class="ttc" id="structdemo_html_a0beb24076411cc1d02c7dcfcedf0f7c3"><div class="ttname"><a href="structdemo.html#a0beb24076411cc1d02c7dcfcedf0f7c3">demo::last_late_id</a></div><div class="ttdeci">uint32_t last_late_id</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00354">cube.c:354</a></div></div>
<div class="ttc" id="structdemo_html_a9bd68668039ac7d6230373ac6d62cc70"><div class="ttname"><a href="structdemo.html#a9bd68668039ac7d6230373ac6d62cc70">demo::syncd_with_actual_presents</a></div><div class="ttdeci">bool syncd_with_actual_presents</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00347">cube.c:347</a></div></div>
<div class="ttc" id="structdemo_html_a96fb9109cbd63ce7dffdcd45d63faef7"><div class="ttname"><a href="structdemo.html#a96fb9109cbd63ce7dffdcd45d63faef7">demo::refresh_duration_multiplier</a></div><div class="ttdeci">uint64_t refresh_duration_multiplier</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00349">cube.c:349</a></div></div>
<div class="ttc" id="structdemo_html_a1311039938bb87188def4bc76ddb2948"><div class="ttname"><a href="structdemo.html#a1311039938bb87188def4bc76ddb2948">demo::refresh_duration</a></div><div class="ttdeci">uint64_t refresh_duration</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00348">cube.c:348</a></div></div>
<div class="ttc" id="structdemo_html_a78b47e3c60ff73da25f26d83c4044209"><div class="ttname"><a href="structdemo.html#a78b47e3c60ff73da25f26d83c4044209">demo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00358">cube.c:358</a></div></div>
<div class="ttc" id="structdemo_html_affe3d21204d2084cc74cb25062cd1420"><div class="ttname"><a href="structdemo.html#affe3d21204d2084cc74cb25062cd1420">demo::fpGetPastPresentationTimingGOOGLE</a></div><div class="ttdeci">PFN_vkGetPastPresentationTimingGOOGLE fpGetPastPresentationTimingGOOGLE</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00389">cube.c:389</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a004704ce51b4b63b3d59eef1d5ea2cee_cgraph.png" border="0" usemap="#cube_8c_a004704ce51b4b63b3d59eef1d5ea2cee_cgraph" alt=""/></div>
<map name="cube_8c_a004704ce51b4b63b3d59eef1d5ea2cee_cgraph" id="cube_8c_a004704ce51b4b63b3d59eef1d5ea2cee_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#ab9ca7a0a208ec589229116f2de6ee77c" title="ActualTimeLate" alt="" coords="215,300,327,327"/>
<area shape="rect" id="node3" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="208,351,335,377"/>
<area shape="rect" id="node4" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="383,351,479,377"/>
<area shape="rect" id="node5" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="527,351,631,377"/>
<area shape="rect" id="node6" href="cube_8c.html#ad1571a7e9407fa30327f858d07ea6702" title="demo_build_image_ownership_cmd" alt="" coords="679,5,905,32"/>
<area shape="rect" id="node7" href="cube_8c.html#a10612fc5c33836b531554ee572b389f2" title="demo_destroy_texture\l_image" alt="" coords="717,57,867,98"/>
<area shape="rect" id="node8" href="cube_8c.html#aa9f275ddb85f8473f44c01a00ccfba63" title="demo_draw_build_cmd" alt="" coords="715,123,869,149"/>
<area shape="rect" id="node9" href="cube_8c.html#a7a35f4639d32b3ac59dd725668a363ba" title="demo_flush_init_cmd" alt="" coords="720,173,864,200"/>
<area shape="rect" id="node10" href="cube_8c.html#a0c4cc92dc1a3456d6cca76e3187f2010" title="demo_prepare_buffers" alt="" coords="717,224,867,251"/>
<area shape="rect" id="node11" href="cube_8c.html#a21da8dc23d75bc75b5dbe7dd01130739" title="demo_prepare_cube_data\l_buffers" alt="" coords="953,255,1124,297"/>
<area shape="rect" id="node13" href="cube_8c.html#a3569c83afeb4ecc4d8d797af29ce89ed" title="demo_prepare_depth" alt="" coords="967,321,1110,348"/>
<area shape="rect" id="node14" href="cube_8c.html#a36308c10e305d94d63e96fc82be78950" title="demo_prepare_descriptor\l_layout" alt="" coords="708,427,876,469"/>
<area shape="rect" id="node15" href="cube_8c.html#a4ee7f5efc65c5972db015c6be8cda380" title="demo_prepare_descriptor_pool" alt="" coords="693,493,891,520"/>
<area shape="rect" id="node16" href="cube_8c.html#ac1957f225fabd1755a0064169fa5f6ba" title="demo_prepare_descriptor_set" alt="" coords="695,544,889,571"/>
<area shape="rect" id="node17" href="cube_8c.html#a3a72610dc44a370494307b568ef3abd6" title="demo_prepare_framebuffers" alt="" coords="701,595,883,621"/>
<area shape="rect" id="node18" href="cube_8c.html#aa80cd8877b6b5d20217c451b207ca9d9" title="demo_prepare_pipeline" alt="" coords="715,645,869,672"/>
<area shape="rect" id="node22" href="cube_8c.html#a4ac6098487e1fc2305847f666891cdec" title="demo_prepare_render_pass" alt="" coords="701,696,883,723"/>
<area shape="rect" id="node23" href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7" title="demo_prepare_textures" alt="" coords="713,376,871,403"/>
<area shape="rect" id="node12" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b" title="memory_type_from_properties" alt="" coords="1172,321,1369,348"/>
<area shape="rect" id="node19" href="cube_8c.html#ab89d9436b88fd3dea5de8cb03de51e94" title="demo_prepare_fs" alt="" coords="978,620,1099,647"/>
<area shape="rect" id="node21" href="cube_8c.html#ab1d134177a8964ce85593b229fc7f688" title="demo_prepare_vs" alt="" coords="977,671,1100,697"/>
<area shape="rect" id="node20" href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c" title="demo_prepare_shader\l_module" alt="" coords="1195,638,1346,679"/>
<area shape="rect" id="node24" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731" title="demo_prepare_texture\l_image" alt="" coords="963,373,1114,414"/>
<area shape="rect" id="node26" href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8" title="demo_set_image_layout" alt="" coords="957,439,1120,465"/>
<area shape="rect" id="node25" href="cube_8c.html#add4fd1e03edd51503c9c554e77a042fa" title="loadTexture" alt="" coords="1226,380,1315,407"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_a004704ce51b4b63b3d59eef1d5ea2cee_icgraph.png" border="0" usemap="#cube_8c_a004704ce51b4b63b3d59eef1d5ea2cee_icgraph" alt=""/></div>
<map name="cube_8c_a004704ce51b4b63b3d59eef1d5ea2cee_icgraph" id="cube_8c_a004704ce51b4b63b3d59eef1d5ea2cee_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="208,5,296,32"/>
<area shape="rect" id="node3" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="595,56,741,83"/>
<area shape="rect" id="node5" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="344,56,423,83"/>
<area shape="rect" id="node4" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="789,95,863,121"/>
<area shape="rect" id="node6" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="471,81,547,108"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a3fbeb810082ceb57b4993b4c49de735b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dumpMatrix </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>note</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">mat4x4&#160;</td>
          <td class="paramname"><em>MVP</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00276">276</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;                                              {</div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;    <span class="keywordtype">int</span> i;</div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;</div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    printf(<span class="stringliteral">&quot;%s: \n&quot;</span>, note);</div><div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    <span class="keywordflow">for</span> (i = 0; i &lt; 4; i++) {</div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;        printf(<span class="stringliteral">&quot;%f, %f, %f, %f\n&quot;</span>, MVP[i][0], MVP[i][1], MVP[i][2], MVP[i][3]);</div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    }</div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;    printf(<span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    fflush(stdout);</div><div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a2a9fa5a1ba7fafecaaadd21f8965fc06"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dumpVec4 </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>note</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">vec4&#160;</td>
          <td class="paramname"><em>vector</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00287">287</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;                                             {</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    printf(<span class="stringliteral">&quot;%s: \n&quot;</span>, note);</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;    printf(<span class="stringliteral">&quot;%f, %f, %f, %f\n&quot;</span>, vector[0], vector[1], vector[2], vector[3]);</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;    printf(<span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;    fflush(stdout);</div><div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a class="anchor" id="add4fd1e03edd51503c9c554e77a042fa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool loadTexture </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>rgba_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VkSubresourceLayout *&#160;</td>
          <td class="paramname"><em>layout</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t *&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t *&#160;</td>
          <td class="paramname"><em>height</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l01458">1458</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00375">demo::height</a>, and <a class="el" href="cube_8c_source.html#l00375">demo::width</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l01491">demo_prepare_texture_image()</a>.</p>
<div class="fragment"><div class="line"><a name="l01458"></a><span class="lineno"> 1458</span>&#160;                                                                                                                         {</div><div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>&#160;    (void)filename;</div><div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>&#160;    <span class="keywordtype">char</span> *cPtr;</div><div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>&#160;    cPtr = (<span class="keywordtype">char</span> *)lunarg_ppm;</div><div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>&#160;    <span class="keywordflow">if</span> ((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *)cPtr &gt;= (lunarg_ppm + lunarg_ppm_len) || strncmp(cPtr, <span class="stringliteral">&quot;P6\n&quot;</span>, 3)) {</div><div class="line"><a name="l01463"></a><span class="lineno"> 1463</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01464"></a><span class="lineno"> 1464</span>&#160;    }</div><div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>&#160;    <span class="keywordflow">while</span> (strncmp(cPtr++, <span class="stringliteral">&quot;\n&quot;</span>, 1))</div><div class="line"><a name="l01466"></a><span class="lineno"> 1466</span>&#160;        ;</div><div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>&#160;    sscanf(cPtr, <span class="stringliteral">&quot;%u %u&quot;</span>, width, height);</div><div class="line"><a name="l01468"></a><span class="lineno"> 1468</span>&#160;    <span class="keywordflow">if</span> (rgba_data == NULL) {</div><div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l01470"></a><span class="lineno"> 1470</span>&#160;    }</div><div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>&#160;    <span class="keywordflow">while</span> (strncmp(cPtr++, <span class="stringliteral">&quot;\n&quot;</span>, 1))</div><div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>&#160;        ;</div><div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>&#160;    <span class="keywordflow">if</span> ((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *)cPtr &gt;= (lunarg_ppm + lunarg_ppm_len) || strncmp(cPtr, <span class="stringliteral">&quot;255\n&quot;</span>, 4)) {</div><div class="line"><a name="l01474"></a><span class="lineno"> 1474</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>&#160;    }</div><div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>&#160;    <span class="keywordflow">while</span> (strncmp(cPtr++, <span class="stringliteral">&quot;\n&quot;</span>, 1))</div><div class="line"><a name="l01477"></a><span class="lineno"> 1477</span>&#160;        ;</div><div class="line"><a name="l01478"></a><span class="lineno"> 1478</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> y = 0; y &lt; *height; y++) {</div><div class="line"><a name="l01479"></a><span class="lineno"> 1479</span>&#160;        uint8_t *rowPtr = rgba_data;</div><div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>&#160;        <span class="keywordflow">for</span> (<span class="keywordtype">int</span> x = 0; x &lt; *width; x++) {</div><div class="line"><a name="l01481"></a><span class="lineno"> 1481</span>&#160;            memcpy(rowPtr, cPtr, 3);</div><div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>&#160;            rowPtr[3] = 255; <span class="comment">/* Alpha of 1 */</span></div><div class="line"><a name="l01483"></a><span class="lineno"> 1483</span>&#160;            rowPtr += 4;</div><div class="line"><a name="l01484"></a><span class="lineno"> 1484</span>&#160;            cPtr += 3;</div><div class="line"><a name="l01485"></a><span class="lineno"> 1485</span>&#160;        }</div><div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>&#160;        rgba_data += layout-&gt;rowPitch;</div><div class="line"><a name="l01487"></a><span class="lineno"> 1487</span>&#160;    }</div><div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l01489"></a><span class="lineno"> 1489</span>&#160;}</div></div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_add4fd1e03edd51503c9c554e77a042fa_icgraph.png" border="0" usemap="#cube_8c_add4fd1e03edd51503c9c554e77a042fa_icgraph" alt=""/></div>
<map name="cube_8c_add4fd1e03edd51503c9c554e77a042fa_icgraph" id="cube_8c_add4fd1e03edd51503c9c554e77a042fa_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731" title="demo_prepare_texture\l_image" alt="" coords="143,35,293,77"/>
<area shape="rect" id="node3" href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7" title="demo_prepare_textures" alt="" coords="341,43,500,69"/>
<area shape="rect" id="node4" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="548,43,652,69"/>
<area shape="rect" id="node5" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="700,93,796,120"/>
<area shape="rect" id="node10" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1803,119,1876,145"/>
<area shape="rect" id="node6" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="844,93,971,120"/>
<area shape="rect" id="node8" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="1221,119,1309,145"/>
<area shape="rect" id="node9" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1608,119,1755,145"/>
<area shape="rect" id="node12" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1484,245,1560,272"/>
<area shape="rect" id="node7" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="1019,93,1173,120"/>
<area shape="rect" id="node11" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1357,156,1436,183"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="aff6bdb11d121e68bf2e3eecc2945ca3b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool memory_type_from_properties </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structdemo.html">demo</a> *&#160;</td>
          <td class="paramname"><em>demo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>typeBits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VkFlags&#160;</td>
          <td class="paramname"><em>requirements_mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>typeIndex</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00598">598</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00368">demo::memory_properties</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l01680">demo_prepare_cube_data_buffers()</a>, <a class="el" href="cube_8c_source.html#l01393">demo_prepare_depth()</a>, and <a class="el" href="cube_8c_source.html#l01491">demo_prepare_texture_image()</a>.</p>
<div class="fragment"><div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;                                                                                                                              {</div><div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;    <span class="comment">// Search memtypes to find first index with those properties</span></div><div class="line"><a name="l00600"></a><span class="lineno">  600</span>&#160;    <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; VK_MAX_MEMORY_TYPES; i++) {</div><div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;        <span class="keywordflow">if</span> ((typeBits &amp; 1) == 1) {</div><div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;            <span class="comment">// Type is available, does it match user properties?</span></div><div class="line"><a name="l00603"></a><span class="lineno">  603</span>&#160;            <span class="keywordflow">if</span> ((demo-&gt;<a class="code" href="structdemo.html#a304121602ddaf81bb53f28c856ea335f">memory_properties</a>.memoryTypes[i].propertyFlags &amp; requirements_mask) == requirements_mask) {</div><div class="line"><a name="l00604"></a><span class="lineno">  604</span>&#160;                *typeIndex = i;</div><div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;                <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00606"></a><span class="lineno">  606</span>&#160;            }</div><div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;        }</div><div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160;        typeBits &gt;&gt;= 1;</div><div class="line"><a name="l00609"></a><span class="lineno">  609</span>&#160;    }</div><div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;    <span class="comment">// No memory types matched, return failure</span></div><div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00612"></a><span class="lineno">  612</span>&#160;}</div><div class="ttc" id="structdemo_html_a304121602ddaf81bb53f28c856ea335f"><div class="ttname"><a href="structdemo.html#a304121602ddaf81bb53f28c856ea335f">demo::memory_properties</a></div><div class="ttdeci">VkPhysicalDeviceMemoryProperties memory_properties</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00368">cube.c:368</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_aff6bdb11d121e68bf2e3eecc2945ca3b_icgraph.png" border="0" usemap="#cube_8c_aff6bdb11d121e68bf2e3eecc2945ca3b_icgraph" alt=""/></div>
<map name="cube_8c_aff6bdb11d121e68bf2e3eecc2945ca3b_icgraph" id="cube_8c_aff6bdb11d121e68bf2e3eecc2945ca3b_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a21da8dc23d75bc75b5dbe7dd01130739" title="demo_prepare_cube_data\l_buffers" alt="" coords="449,5,620,47"/>
<area shape="rect" id="node12" href="cube_8c.html#a3569c83afeb4ecc4d8d797af29ce89ed" title="demo_prepare_depth" alt="" coords="255,63,397,90"/>
<area shape="rect" id="node13" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731" title="demo_prepare_texture\l_image" alt="" coords="251,115,401,156"/>
<area shape="rect" id="node3" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="668,71,772,98"/>
<area shape="rect" id="node4" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="820,122,916,149"/>
<area shape="rect" id="node9" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="1923,147,1996,174"/>
<area shape="rect" id="node5" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="964,122,1091,149"/>
<area shape="rect" id="node7" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="1341,147,1429,174"/>
<area shape="rect" id="node8" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="1728,147,1875,174"/>
<area shape="rect" id="node11" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="1604,274,1680,301"/>
<area shape="rect" id="node6" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="1139,122,1293,149"/>
<area shape="rect" id="node10" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="1477,185,1556,211"/>
<area shape="rect" id="node14" href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7" title="demo_prepare_textures" alt="" coords="455,122,614,149"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="aaeec9c5b7aa4be5544a74d2030e12a3a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int WINAPI WinMain </td>
          <td>(</td>
          <td class="paramtype">HINSTANCE&#160;</td>
          <td class="paramname"><em>hInstance</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">HINSTANCE&#160;</td>
          <td class="paramname"><em>hPrevInstance</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LPSTR&#160;</td>
          <td class="paramname"><em>pCmdLine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>nCmdShow</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l03702">3702</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l00307">APP_NAME_STR_LEN</a>, <a class="el" href="cube_8c_source.html#l00067">APP_SHORT_NAME</a>, <a class="el" href="cube_8c_source.html#l00412">demo::cmd</a>, <a class="el" href="cube_8c_source.html#l00308">demo::connection</a>, <a class="el" href="cube_8c_source.html#l02197">demo_cleanup()</a>, <a class="el" href="cube_8c_source.html#l02387">demo_create_window()</a>, <a class="el" href="cube_8c_source.html#l03608">demo_init()</a>, <a class="el" href="cube_8c_source.html#l03278">demo_init_vk_swapchain()</a>, <a class="el" href="cube_8c_source.html#l02099">demo_prepare()</a>, <a class="el" href="cube_8c_source.html#l02344">demo_run()</a>, <a class="el" href="cube_8c_source.html#l00309">demo::name</a>, <a class="el" href="cube_8c_source.html#l00339">demo::prepared</a>, <a class="el" href="cube_8c_source.html#l00423">demo::spin_angle</a>, <a class="el" href="cube_8c_source.html#l00174">validation_error</a>, <a class="el" href="cube_8c_source.html#l00168">texture_object::view</a>, and <a class="el" href="cube_8c_source.html#l00310">demo::window</a>.</p>
<div class="fragment"><div class="line"><a name="l03702"></a><span class="lineno"> 3702</span>&#160;                                                                                               {</div><div class="line"><a name="l03703"></a><span class="lineno"> 3703</span>&#160;    MSG msg;    <span class="comment">// message</span></div><div class="line"><a name="l03704"></a><span class="lineno"> 3704</span>&#160;    <span class="keywordtype">bool</span> done;  <span class="comment">// flag saying when app is complete</span></div><div class="line"><a name="l03705"></a><span class="lineno"> 3705</span>&#160;    <span class="keywordtype">int</span> argc;</div><div class="line"><a name="l03706"></a><span class="lineno"> 3706</span>&#160;    <span class="keywordtype">char</span> **argv;</div><div class="line"><a name="l03707"></a><span class="lineno"> 3707</span>&#160;</div><div class="line"><a name="l03708"></a><span class="lineno"> 3708</span>&#160;    <span class="comment">// Ensure wParam is initialized.</span></div><div class="line"><a name="l03709"></a><span class="lineno"> 3709</span>&#160;    msg.wParam = 0;</div><div class="line"><a name="l03710"></a><span class="lineno"> 3710</span>&#160;</div><div class="line"><a name="l03711"></a><span class="lineno"> 3711</span>&#160;    <span class="comment">// Use the CommandLine functions to get the command line arguments.</span></div><div class="line"><a name="l03712"></a><span class="lineno"> 3712</span>&#160;    <span class="comment">// Unfortunately, Microsoft outputs</span></div><div class="line"><a name="l03713"></a><span class="lineno"> 3713</span>&#160;    <span class="comment">// this information as wide characters for Unicode, and we simply want the</span></div><div class="line"><a name="l03714"></a><span class="lineno"> 3714</span>&#160;    <span class="comment">// Ascii version to be compatible</span></div><div class="line"><a name="l03715"></a><span class="lineno"> 3715</span>&#160;    <span class="comment">// with the non-Windows side.  So, we have to convert the information to</span></div><div class="line"><a name="l03716"></a><span class="lineno"> 3716</span>&#160;    <span class="comment">// Ascii character strings.</span></div><div class="line"><a name="l03717"></a><span class="lineno"> 3717</span>&#160;    LPWSTR *commandLineArgs = CommandLineToArgvW(GetCommandLineW(), &amp;argc);</div><div class="line"><a name="l03718"></a><span class="lineno"> 3718</span>&#160;    <span class="keywordflow">if</span> (NULL == commandLineArgs) {</div><div class="line"><a name="l03719"></a><span class="lineno"> 3719</span>&#160;        argc = 0;</div><div class="line"><a name="l03720"></a><span class="lineno"> 3720</span>&#160;    }</div><div class="line"><a name="l03721"></a><span class="lineno"> 3721</span>&#160;</div><div class="line"><a name="l03722"></a><span class="lineno"> 3722</span>&#160;    <span class="keywordflow">if</span> (argc &gt; 0) {</div><div class="line"><a name="l03723"></a><span class="lineno"> 3723</span>&#160;        argv = (<span class="keywordtype">char</span> **)malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *) * argc);</div><div class="line"><a name="l03724"></a><span class="lineno"> 3724</span>&#160;        <span class="keywordflow">if</span> (argv == NULL) {</div><div class="line"><a name="l03725"></a><span class="lineno"> 3725</span>&#160;            argc = 0;</div><div class="line"><a name="l03726"></a><span class="lineno"> 3726</span>&#160;        } <span class="keywordflow">else</span> {</div><div class="line"><a name="l03727"></a><span class="lineno"> 3727</span>&#160;            <span class="keywordflow">for</span> (<span class="keywordtype">int</span> iii = 0; iii &lt; argc; iii++) {</div><div class="line"><a name="l03728"></a><span class="lineno"> 3728</span>&#160;                <span class="keywordtype">size_t</span> wideCharLen = wcslen(commandLineArgs[iii]);</div><div class="line"><a name="l03729"></a><span class="lineno"> 3729</span>&#160;                <span class="keywordtype">size_t</span> numConverted = 0;</div><div class="line"><a name="l03730"></a><span class="lineno"> 3730</span>&#160;</div><div class="line"><a name="l03731"></a><span class="lineno"> 3731</span>&#160;                argv[iii] = (<span class="keywordtype">char</span> *)malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">char</span>) * (wideCharLen + 1));</div><div class="line"><a name="l03732"></a><span class="lineno"> 3732</span>&#160;                <span class="keywordflow">if</span> (argv[iii] != NULL) {</div><div class="line"><a name="l03733"></a><span class="lineno"> 3733</span>&#160;                    wcstombs_s(&amp;numConverted, argv[iii], wideCharLen + 1, commandLineArgs[iii], wideCharLen + 1);</div><div class="line"><a name="l03734"></a><span class="lineno"> 3734</span>&#160;                }</div><div class="line"><a name="l03735"></a><span class="lineno"> 3735</span>&#160;            }</div><div class="line"><a name="l03736"></a><span class="lineno"> 3736</span>&#160;        }</div><div class="line"><a name="l03737"></a><span class="lineno"> 3737</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l03738"></a><span class="lineno"> 3738</span>&#160;        argv = NULL;</div><div class="line"><a name="l03739"></a><span class="lineno"> 3739</span>&#160;    }</div><div class="line"><a name="l03740"></a><span class="lineno"> 3740</span>&#160;</div><div class="line"><a name="l03741"></a><span class="lineno"> 3741</span>&#160;    <a class="code" href="cube_8c.html#a9614fd51f6e418355a34964db328d781">demo_init</a>(&amp;<a class="code" href="structdemo.html">demo</a>, argc, argv);</div><div class="line"><a name="l03742"></a><span class="lineno"> 3742</span>&#160;</div><div class="line"><a name="l03743"></a><span class="lineno"> 3743</span>&#160;    <span class="comment">// Free up the items we had to allocate for the command line arguments.</span></div><div class="line"><a name="l03744"></a><span class="lineno"> 3744</span>&#160;    <span class="keywordflow">if</span> (argc &gt; 0 &amp;&amp; argv != NULL) {</div><div class="line"><a name="l03745"></a><span class="lineno"> 3745</span>&#160;        <span class="keywordflow">for</span> (<span class="keywordtype">int</span> iii = 0; iii &lt; argc; iii++) {</div><div class="line"><a name="l03746"></a><span class="lineno"> 3746</span>&#160;            <span class="keywordflow">if</span> (argv[iii] != NULL) {</div><div class="line"><a name="l03747"></a><span class="lineno"> 3747</span>&#160;                free(argv[iii]);</div><div class="line"><a name="l03748"></a><span class="lineno"> 3748</span>&#160;            }</div><div class="line"><a name="l03749"></a><span class="lineno"> 3749</span>&#160;        }</div><div class="line"><a name="l03750"></a><span class="lineno"> 3750</span>&#160;        free(argv);</div><div class="line"><a name="l03751"></a><span class="lineno"> 3751</span>&#160;    }</div><div class="line"><a name="l03752"></a><span class="lineno"> 3752</span>&#160;</div><div class="line"><a name="l03753"></a><span class="lineno"> 3753</span>&#160;    <a class="code" href="structdemo.html">demo</a>.<a class="code" href="structdemo.html#a4f271161fb166d561f5da630dd0de222">connection</a> = hInstance;</div><div class="line"><a name="l03754"></a><span class="lineno"> 3754</span>&#160;    strncpy(<a class="code" href="structdemo.html">demo</a>.<a class="code" href="structdemo.html#abcd428d42a8168aba23e333113803a23">name</a>, <span class="stringliteral">&quot;cube&quot;</span>, <a class="code" href="cube_8c.html#a17ade23ed4742947e6c374209ca22fcd">APP_NAME_STR_LEN</a>);</div><div class="line"><a name="l03755"></a><span class="lineno"> 3755</span>&#160;    <a class="code" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155">demo_create_window</a>(&amp;<a class="code" href="structdemo.html">demo</a>);</div><div class="line"><a name="l03756"></a><span class="lineno"> 3756</span>&#160;    <a class="code" href="cube_8c.html#ab8af4815cac383b0436928fe474b98b3">demo_init_vk_swapchain</a>(&amp;<a class="code" href="structdemo.html">demo</a>);</div><div class="line"><a name="l03757"></a><span class="lineno"> 3757</span>&#160;</div><div class="line"><a name="l03758"></a><span class="lineno"> 3758</span>&#160;    <a class="code" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da">demo_prepare</a>(&amp;<a class="code" href="structdemo.html">demo</a>);</div><div class="line"><a name="l03759"></a><span class="lineno"> 3759</span>&#160;</div><div class="line"><a name="l03760"></a><span class="lineno"> 3760</span>&#160;    done = <span class="keyword">false</span>;  <span class="comment">// initialize loop condition variable</span></div><div class="line"><a name="l03761"></a><span class="lineno"> 3761</span>&#160;</div><div class="line"><a name="l03762"></a><span class="lineno"> 3762</span>&#160;    <span class="comment">// main message loop</span></div><div class="line"><a name="l03763"></a><span class="lineno"> 3763</span>&#160;    <span class="keywordflow">while</span> (!done) {</div><div class="line"><a name="l03764"></a><span class="lineno"> 3764</span>&#160;        PeekMessage(&amp;msg, NULL, 0, 0, PM_REMOVE);</div><div class="line"><a name="l03765"></a><span class="lineno"> 3765</span>&#160;        <span class="keywordflow">if</span> (msg.message == WM_QUIT)  <span class="comment">// check for a quit message</span></div><div class="line"><a name="l03766"></a><span class="lineno"> 3766</span>&#160;        {</div><div class="line"><a name="l03767"></a><span class="lineno"> 3767</span>&#160;            done = <span class="keyword">true</span>;  <span class="comment">// if found, quit app</span></div><div class="line"><a name="l03768"></a><span class="lineno"> 3768</span>&#160;        } <span class="keywordflow">else</span> {</div><div class="line"><a name="l03769"></a><span class="lineno"> 3769</span>&#160;            <span class="comment">/* Translate and dispatch to event queue*/</span></div><div class="line"><a name="l03770"></a><span class="lineno"> 3770</span>&#160;            TranslateMessage(&amp;msg);</div><div class="line"><a name="l03771"></a><span class="lineno"> 3771</span>&#160;            DispatchMessage(&amp;msg);</div><div class="line"><a name="l03772"></a><span class="lineno"> 3772</span>&#160;        }</div><div class="line"><a name="l03773"></a><span class="lineno"> 3773</span>&#160;        RedrawWindow(<a class="code" href="structdemo.html">demo</a>.<a class="code" href="structdemo.html#a096ec114abccb153f4043e8b1c75be22">window</a>, NULL, NULL, RDW_INTERNALPAINT);</div><div class="line"><a name="l03774"></a><span class="lineno"> 3774</span>&#160;    }</div><div class="line"><a name="l03775"></a><span class="lineno"> 3775</span>&#160;</div><div class="line"><a name="l03776"></a><span class="lineno"> 3776</span>&#160;    <a class="code" href="cube_8c.html#ae1040d749c8bf35f9b48f04879e65928">demo_cleanup</a>(&amp;<a class="code" href="structdemo.html">demo</a>);</div><div class="line"><a name="l03777"></a><span class="lineno"> 3777</span>&#160;</div><div class="line"><a name="l03778"></a><span class="lineno"> 3778</span>&#160;    <span class="keywordflow">return</span> (<span class="keywordtype">int</span>)msg.wParam;</div><div class="line"><a name="l03779"></a><span class="lineno"> 3779</span>&#160;}</div><div class="ttc" id="cube_8c_html_a0fcfc933d495ab4fcf98493677e3d8da"><div class="ttname"><a href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da">demo_prepare</a></div><div class="ttdeci">static void demo_prepare(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l02099">cube.c:2099</a></div></div>
<div class="ttc" id="structdemo_html_a4f271161fb166d561f5da630dd0de222"><div class="ttname"><a href="structdemo.html#a4f271161fb166d561f5da630dd0de222">demo::connection</a></div><div class="ttdeci">HINSTANCE connection</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00308">cube.c:308</a></div></div>
<div class="ttc" id="cube_8c_html_a3553c2367998ea3c060aa8f3d64ed155"><div class="ttname"><a href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155">demo_create_window</a></div><div class="ttdeci">static void demo_create_window(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l02387">cube.c:2387</a></div></div>
<div class="ttc" id="cube_8c_html_a17ade23ed4742947e6c374209ca22fcd"><div class="ttname"><a href="cube_8c.html#a17ade23ed4742947e6c374209ca22fcd">APP_NAME_STR_LEN</a></div><div class="ttdeci">#define APP_NAME_STR_LEN</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00307">cube.c:307</a></div></div>
<div class="ttc" id="structdemo_html_abcd428d42a8168aba23e333113803a23"><div class="ttname"><a href="structdemo.html#abcd428d42a8168aba23e333113803a23">demo::name</a></div><div class="ttdeci">char name[APP_NAME_STR_LEN]</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00309">cube.c:309</a></div></div>
<div class="ttc" id="cube_8c_html_ae1040d749c8bf35f9b48f04879e65928"><div class="ttname"><a href="cube_8c.html#ae1040d749c8bf35f9b48f04879e65928">demo_cleanup</a></div><div class="ttdeci">static void demo_cleanup(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l02197">cube.c:2197</a></div></div>
<div class="ttc" id="cube_8c_html_ab8af4815cac383b0436928fe474b98b3"><div class="ttname"><a href="cube_8c.html#ab8af4815cac383b0436928fe474b98b3">demo_init_vk_swapchain</a></div><div class="ttdeci">static void demo_init_vk_swapchain(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l03278">cube.c:3278</a></div></div>
<div class="ttc" id="structdemo_html"><div class="ttname"><a href="structdemo.html">demo</a></div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00305">cube.c:305</a></div></div>
<div class="ttc" id="structdemo_html_a096ec114abccb153f4043e8b1c75be22"><div class="ttname"><a href="structdemo.html#a096ec114abccb153f4043e8b1c75be22">demo::window</a></div><div class="ttdeci">HWND window</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00310">cube.c:310</a></div></div>
<div class="ttc" id="cube_8c_html_a9614fd51f6e418355a34964db328d781"><div class="ttname"><a href="cube_8c.html#a9614fd51f6e418355a34964db328d781">demo_init</a></div><div class="ttdeci">static void demo_init(struct demo *demo, int argc, char **argv)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l03608">cube.c:3608</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_aaeec9c5b7aa4be5544a74d2030e12a3a_cgraph.png" border="0" usemap="#cube_8c_aaeec9c5b7aa4be5544a74d2030e12a3a_cgraph" alt=""/></div>
<map name="cube_8c_aaeec9c5b7aa4be5544a74d2030e12a3a_cgraph" id="cube_8c_aaeec9c5b7aa4be5544a74d2030e12a3a_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#ae1040d749c8bf35f9b48f04879e65928" title="demo_cleanup" alt="" coords="156,249,263,276"/>
<area shape="rect" id="node3" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="136,452,283,479"/>
<area shape="rect" id="node6" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="1440,351,1544,377"/>
<area shape="rect" id="node32" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="588,427,667,453"/>
<area shape="rect" id="node34" href="cube_8c.html#a9614fd51f6e418355a34964db328d781" title="demo_init" alt="" coords="170,604,249,631"/>
<area shape="rect" id="node40" href="cube_8c.html#ab8af4815cac383b0436928fe474b98b3" title="demo_init_vk_swapchain" alt="" coords="127,680,292,707"/>
<area shape="rect" id="node4" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="767,452,855,479"/>
<area shape="rect" id="node5" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="1296,401,1392,428"/>
<area shape="rect" id="node33" href="cube_8c.html#ae749e989b362e19783c7af4a2bf46c95" title="WndProc" alt="" coords="376,401,452,428"/>
<area shape="rect" id="node28" href="cube_8c.html#a2967b050fc63b30dc0cf382fbcf8f3c6" title="demo_update_data_buffer" alt="" coords="903,452,1073,479"/>
<area shape="rect" id="node29" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="911,401,1065,428"/>
<area shape="rect" id="node7" href="cube_8c.html#ad1571a7e9407fa30327f858d07ea6702" title="demo_build_image_ownership_cmd" alt="" coords="1592,5,1819,32"/>
<area shape="rect" id="node8" href="cube_8c.html#a10612fc5c33836b531554ee572b389f2" title="demo_destroy_texture\l_image" alt="" coords="1630,57,1781,98"/>
<area shape="rect" id="node9" href="cube_8c.html#aa9f275ddb85f8473f44c01a00ccfba63" title="demo_draw_build_cmd" alt="" coords="1628,123,1783,149"/>
<area shape="rect" id="node10" href="cube_8c.html#a7a35f4639d32b3ac59dd725668a363ba" title="demo_flush_init_cmd" alt="" coords="1633,173,1777,200"/>
<area shape="rect" id="node11" href="cube_8c.html#a0c4cc92dc1a3456d6cca76e3187f2010" title="demo_prepare_buffers" alt="" coords="1631,224,1780,251"/>
<area shape="rect" id="node12" href="cube_8c.html#a21da8dc23d75bc75b5dbe7dd01130739" title="demo_prepare_cube_data\l_buffers" alt="" coords="1867,255,2037,297"/>
<area shape="rect" id="node14" href="cube_8c.html#a3569c83afeb4ecc4d8d797af29ce89ed" title="demo_prepare_depth" alt="" coords="1881,321,2023,348"/>
<area shape="rect" id="node15" href="cube_8c.html#a36308c10e305d94d63e96fc82be78950" title="demo_prepare_descriptor\l_layout" alt="" coords="1621,427,1789,469"/>
<area shape="rect" id="node16" href="cube_8c.html#a4ee7f5efc65c5972db015c6be8cda380" title="demo_prepare_descriptor_pool" alt="" coords="1606,493,1805,520"/>
<area shape="rect" id="node17" href="cube_8c.html#ac1957f225fabd1755a0064169fa5f6ba" title="demo_prepare_descriptor_set" alt="" coords="1609,544,1802,571"/>
<area shape="rect" id="node18" href="cube_8c.html#a3a72610dc44a370494307b568ef3abd6" title="demo_prepare_framebuffers" alt="" coords="1615,595,1796,621"/>
<area shape="rect" id="node19" href="cube_8c.html#aa80cd8877b6b5d20217c451b207ca9d9" title="demo_prepare_pipeline" alt="" coords="1628,645,1783,672"/>
<area shape="rect" id="node23" href="cube_8c.html#a4ac6098487e1fc2305847f666891cdec" title="demo_prepare_render_pass" alt="" coords="1614,696,1797,723"/>
<area shape="rect" id="node24" href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7" title="demo_prepare_textures" alt="" coords="1626,376,1785,403"/>
<area shape="rect" id="node13" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b" title="memory_type_from_properties" alt="" coords="2085,321,2283,348"/>
<area shape="rect" id="node20" href="cube_8c.html#ab89d9436b88fd3dea5de8cb03de51e94" title="demo_prepare_fs" alt="" coords="1891,620,2013,647"/>
<area shape="rect" id="node22" href="cube_8c.html#ab1d134177a8964ce85593b229fc7f688" title="demo_prepare_vs" alt="" coords="1891,671,2013,697"/>
<area shape="rect" id="node21" href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c" title="demo_prepare_shader\l_module" alt="" coords="2109,638,2259,679"/>
<area shape="rect" id="node25" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731" title="demo_prepare_texture\l_image" alt="" coords="1877,373,2027,414"/>
<area shape="rect" id="node27" href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8" title="demo_set_image_layout" alt="" coords="1871,439,2033,465"/>
<area shape="rect" id="node26" href="cube_8c.html#add4fd1e03edd51503c9c554e77a042fa" title="loadTexture" alt="" coords="2139,380,2229,407"/>
<area shape="rect" id="node30" href="cube_8c.html#ab9ca7a0a208ec589229116f2de6ee77c" title="ActualTimeLate" alt="" coords="1129,452,1241,479"/>
<area shape="rect" id="node31" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="1121,401,1248,428"/>
<area shape="rect" id="node35" href="cube_8c.html#ad89af5ea893ea45fdcd5478c0eb8edde" title="demo_init_connection" alt="" coords="340,604,488,631"/>
<area shape="rect" id="node36" href="cube_8c.html#abdcd6d1f2fdbb957fd5c0337d86a286c" title="demo_init_vk" alt="" coords="365,655,463,681"/>
<area shape="rect" id="node37" href="cube_8c.html#a1714a35ca475fd30144cd4090d94d286" title="DbgMsg" alt="" coords="592,655,663,681"/>
<area shape="rect" id="node38" href="cube_8c.html#a47431f229fafc6047bb34487ee34151a" title="debug_messenger_callback" alt="" coords="536,705,719,732"/>
<area shape="rect" id="node39" href="cube_8c.html#abcfbf263b3a2885f094ece366b4c2a5b" title="demo_check_layers" alt="" coords="558,604,697,631"/>
<area shape="rect" id="node41" href="cube_8c.html#ac570d41514a55546127adf73c8faef66" title="demo_create_device" alt="" coords="344,705,484,732"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ae749e989b362e19783c7af4a2bf46c95"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LRESULT CALLBACK WndProc </td>
          <td>(</td>
          <td class="paramtype">HWND&#160;</td>
          <td class="paramname"><em>hWnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">UINT&#160;</td>
          <td class="paramname"><em>uMsg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">WPARAM&#160;</td>
          <td class="paramname"><em>wParam</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LPARAM&#160;</td>
          <td class="paramname"><em>lParam</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l02355">2355</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>References <a class="el" href="cube_8c_source.html#l02283">demo_resize()</a>, <a class="el" href="cube_8c_source.html#l02344">demo_run()</a>, <a class="el" href="cube_8c_source.html#l00375">demo::height</a>, <a class="el" href="cube_8c_source.html#l00311">demo::minsize</a>, <a class="el" href="cube_8c_source.html#l00174">validation_error</a>, and <a class="el" href="cube_8c_source.html#l00375">demo::width</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02387">demo_create_window()</a>.</p>
<div class="fragment"><div class="line"><a name="l02355"></a><span class="lineno"> 2355</span>&#160;                                                                             {</div><div class="line"><a name="l02356"></a><span class="lineno"> 2356</span>&#160;    <span class="keywordflow">switch</span> (uMsg) {</div><div class="line"><a name="l02357"></a><span class="lineno"> 2357</span>&#160;        <span class="keywordflow">case</span> WM_CLOSE:</div><div class="line"><a name="l02358"></a><span class="lineno"> 2358</span>&#160;            PostQuitMessage(<a class="code" href="cube_8c.html#aa2a7e938c1d845c6a71f43750db0fd07">validation_error</a>);</div><div class="line"><a name="l02359"></a><span class="lineno"> 2359</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l02360"></a><span class="lineno"> 2360</span>&#160;        <span class="keywordflow">case</span> WM_PAINT:</div><div class="line"><a name="l02361"></a><span class="lineno"> 2361</span>&#160;            <span class="comment">// The validation callback calls MessageBox which can generate paint</span></div><div class="line"><a name="l02362"></a><span class="lineno"> 2362</span>&#160;            <span class="comment">// events - don&#39;t make more Vulkan calls if we got here from the</span></div><div class="line"><a name="l02363"></a><span class="lineno"> 2363</span>&#160;            <span class="comment">// callback</span></div><div class="line"><a name="l02364"></a><span class="lineno"> 2364</span>&#160;            <span class="keywordflow">if</span> (!in_callback) {</div><div class="line"><a name="l02365"></a><span class="lineno"> 2365</span>&#160;                <a class="code" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b">demo_run</a>(&amp;<a class="code" href="structdemo.html">demo</a>);</div><div class="line"><a name="l02366"></a><span class="lineno"> 2366</span>&#160;            }</div><div class="line"><a name="l02367"></a><span class="lineno"> 2367</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l02368"></a><span class="lineno"> 2368</span>&#160;        <span class="keywordflow">case</span> WM_GETMINMAXINFO:  <span class="comment">// set window&#39;s minimum size</span></div><div class="line"><a name="l02369"></a><span class="lineno"> 2369</span>&#160;            ((MINMAXINFO *)lParam)-&gt;ptMinTrackSize = <a class="code" href="structdemo.html">demo</a>.<a class="code" href="structdemo.html#a7b4762aacfde2370774635836e7e6e8f">minsize</a>;</div><div class="line"><a name="l02370"></a><span class="lineno"> 2370</span>&#160;            <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l02371"></a><span class="lineno"> 2371</span>&#160;        <span class="keywordflow">case</span> WM_SIZE:</div><div class="line"><a name="l02372"></a><span class="lineno"> 2372</span>&#160;            <span class="comment">// Resize the application to the new window size, except when</span></div><div class="line"><a name="l02373"></a><span class="lineno"> 2373</span>&#160;            <span class="comment">// it was minimized. Vulkan doesn&#39;t support images or swapchains</span></div><div class="line"><a name="l02374"></a><span class="lineno"> 2374</span>&#160;            <span class="comment">// with width=0 and height=0.</span></div><div class="line"><a name="l02375"></a><span class="lineno"> 2375</span>&#160;            <span class="keywordflow">if</span> (wParam != SIZE_MINIMIZED) {</div><div class="line"><a name="l02376"></a><span class="lineno"> 2376</span>&#160;                <a class="code" href="structdemo.html">demo</a>.<a class="code" href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">width</a> = lParam &amp; 0xffff;</div><div class="line"><a name="l02377"></a><span class="lineno"> 2377</span>&#160;                <a class="code" href="structdemo.html">demo</a>.<a class="code" href="structdemo.html#a471d07293ae638531f808771c9975c07">height</a> = (lParam &amp; 0xffff0000) &gt;&gt; 16;</div><div class="line"><a name="l02378"></a><span class="lineno"> 2378</span>&#160;                <a class="code" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a">demo_resize</a>(&amp;<a class="code" href="structdemo.html">demo</a>);</div><div class="line"><a name="l02379"></a><span class="lineno"> 2379</span>&#160;            }</div><div class="line"><a name="l02380"></a><span class="lineno"> 2380</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l02381"></a><span class="lineno"> 2381</span>&#160;        <span class="keywordflow">default</span>:</div><div class="line"><a name="l02382"></a><span class="lineno"> 2382</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l02383"></a><span class="lineno"> 2383</span>&#160;    }</div><div class="line"><a name="l02384"></a><span class="lineno"> 2384</span>&#160;    <span class="keywordflow">return</span> (DefWindowProc(hWnd, uMsg, wParam, lParam));</div><div class="line"><a name="l02385"></a><span class="lineno"> 2385</span>&#160;}</div><div class="ttc" id="cube_8c_html_a8fb1a4c54cb4307dda563a41fb31459b"><div class="ttname"><a href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b">demo_run</a></div><div class="ttdeci">static void demo_run(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l02344">cube.c:2344</a></div></div>
<div class="ttc" id="structdemo_html_a7b4762aacfde2370774635836e7e6e8f"><div class="ttname"><a href="structdemo.html#a7b4762aacfde2370774635836e7e6e8f">demo::minsize</a></div><div class="ttdeci">POINT minsize</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00311">cube.c:311</a></div></div>
<div class="ttc" id="cube_8c_html_ac51a47d75843a542182cb6c2e997c67a"><div class="ttname"><a href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a">demo_resize</a></div><div class="ttdeci">static void demo_resize(struct demo *demo)</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l02283">cube.c:2283</a></div></div>
<div class="ttc" id="cube_8c_html_aa2a7e938c1d845c6a71f43750db0fd07"><div class="ttname"><a href="cube_8c.html#aa2a7e938c1d845c6a71f43750db0fd07">validation_error</a></div><div class="ttdeci">static int validation_error</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00174">cube.c:174</a></div></div>
<div class="ttc" id="structdemo_html_a471d07293ae638531f808771c9975c07"><div class="ttname"><a href="structdemo.html#a471d07293ae638531f808771c9975c07">demo::height</a></div><div class="ttdeci">int height</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="structdemo_html_a79020e20ddd6a4fe9bc9489a12d05696"><div class="ttname"><a href="structdemo.html#a79020e20ddd6a4fe9bc9489a12d05696">demo::width</a></div><div class="ttdeci">int width</div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00375">cube.c:375</a></div></div>
<div class="ttc" id="structdemo_html"><div class="ttname"><a href="structdemo.html">demo</a></div><div class="ttdef"><b>Definition:</b> <a href="cube_8c_source.html#l00305">cube.c:305</a></div></div>
</div><!-- fragment -->
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ae749e989b362e19783c7af4a2bf46c95_cgraph.png" border="0" usemap="#cube_8c_ae749e989b362e19783c7af4a2bf46c95_cgraph" alt=""/></div>
<map name="cube_8c_ae749e989b362e19783c7af4a2bf46c95_cgraph" id="cube_8c_ae749e989b362e19783c7af4a2bf46c95_cgraph">
<area shape="rect" id="node2" href="cube_8c.html#ac51a47d75843a542182cb6c2e997c67a" title="demo_resize" alt="" coords="785,351,881,377"/>
<area shape="rect" id="node25" href="cube_8c.html#a8fb1a4c54cb4307dda563a41fb31459b" title="demo_run" alt="" coords="129,376,208,403"/>
<area shape="rect" id="node3" href="cube_8c.html#a0fcfc933d495ab4fcf98493677e3d8da" title="demo_prepare" alt="" coords="929,351,1033,377"/>
<area shape="rect" id="node4" href="cube_8c.html#ad1571a7e9407fa30327f858d07ea6702" title="demo_build_image_ownership_cmd" alt="" coords="1081,5,1308,32"/>
<area shape="rect" id="node5" href="cube_8c.html#a10612fc5c33836b531554ee572b389f2" title="demo_destroy_texture\l_image" alt="" coords="1119,57,1270,98"/>
<area shape="rect" id="node6" href="cube_8c.html#aa9f275ddb85f8473f44c01a00ccfba63" title="demo_draw_build_cmd" alt="" coords="1117,123,1272,149"/>
<area shape="rect" id="node7" href="cube_8c.html#a7a35f4639d32b3ac59dd725668a363ba" title="demo_flush_init_cmd" alt="" coords="1123,173,1267,200"/>
<area shape="rect" id="node8" href="cube_8c.html#a0c4cc92dc1a3456d6cca76e3187f2010" title="demo_prepare_buffers" alt="" coords="1120,224,1269,251"/>
<area shape="rect" id="node9" href="cube_8c.html#a21da8dc23d75bc75b5dbe7dd01130739" title="demo_prepare_cube_data\l_buffers" alt="" coords="1356,255,1527,297"/>
<area shape="rect" id="node11" href="cube_8c.html#a3569c83afeb4ecc4d8d797af29ce89ed" title="demo_prepare_depth" alt="" coords="1370,321,1513,348"/>
<area shape="rect" id="node12" href="cube_8c.html#a36308c10e305d94d63e96fc82be78950" title="demo_prepare_descriptor\l_layout" alt="" coords="1111,427,1279,469"/>
<area shape="rect" id="node13" href="cube_8c.html#a4ee7f5efc65c5972db015c6be8cda380" title="demo_prepare_descriptor_pool" alt="" coords="1095,493,1294,520"/>
<area shape="rect" id="node14" href="cube_8c.html#ac1957f225fabd1755a0064169fa5f6ba" title="demo_prepare_descriptor_set" alt="" coords="1098,544,1291,571"/>
<area shape="rect" id="node15" href="cube_8c.html#a3a72610dc44a370494307b568ef3abd6" title="demo_prepare_framebuffers" alt="" coords="1104,595,1285,621"/>
<area shape="rect" id="node16" href="cube_8c.html#aa80cd8877b6b5d20217c451b207ca9d9" title="demo_prepare_pipeline" alt="" coords="1117,645,1272,672"/>
<area shape="rect" id="node20" href="cube_8c.html#a4ac6098487e1fc2305847f666891cdec" title="demo_prepare_render_pass" alt="" coords="1103,696,1286,723"/>
<area shape="rect" id="node21" href="cube_8c.html#a0316bd7d613330a9963098b02a6396d7" title="demo_prepare_textures" alt="" coords="1115,376,1274,403"/>
<area shape="rect" id="node10" href="cube_8c.html#aff6bdb11d121e68bf2e3eecc2945ca3b" title="memory_type_from_properties" alt="" coords="1575,321,1772,348"/>
<area shape="rect" id="node17" href="cube_8c.html#ab89d9436b88fd3dea5de8cb03de51e94" title="demo_prepare_fs" alt="" coords="1381,620,1502,647"/>
<area shape="rect" id="node19" href="cube_8c.html#ab1d134177a8964ce85593b229fc7f688" title="demo_prepare_vs" alt="" coords="1380,671,1503,697"/>
<area shape="rect" id="node18" href="cube_8c.html#a9d15bfd7acf51a14826bbfe1d52da09c" title="demo_prepare_shader\l_module" alt="" coords="1598,638,1749,679"/>
<area shape="rect" id="node22" href="cube_8c.html#a947291086c104a6dd03b8f6a2fc28731" title="demo_prepare_texture\l_image" alt="" coords="1366,373,1517,414"/>
<area shape="rect" id="node24" href="cube_8c.html#aba0ddac08f75117254d652598aeb72f8" title="demo_set_image_layout" alt="" coords="1360,439,1523,465"/>
<area shape="rect" id="node23" href="cube_8c.html#add4fd1e03edd51503c9c554e77a042fa" title="loadTexture" alt="" coords="1629,380,1718,407"/>
<area shape="rect" id="node26" href="cube_8c.html#a68587107d1c17fe6680e438488b9a616" title="demo_draw" alt="" coords="256,389,344,416"/>
<area shape="rect" id="node27" href="cube_8c.html#a2967b050fc63b30dc0cf382fbcf8f3c6" title="demo_update_data_buffer" alt="" coords="392,452,563,479"/>
<area shape="rect" id="node28" href="cube_8c.html#a004704ce51b4b63b3d59eef1d5ea2cee" title="DemoUpdateTargetIPD" alt="" coords="400,401,555,428"/>
<area shape="rect" id="node29" href="cube_8c.html#ab9ca7a0a208ec589229116f2de6ee77c" title="ActualTimeLate" alt="" coords="618,452,730,479"/>
<area shape="rect" id="node30" href="cube_8c.html#aef0d76102bd69a61b3bc49beecae77ca" title="CanPresentEarlier" alt="" coords="611,401,737,428"/>
</map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="cube_8c_ae749e989b362e19783c7af4a2bf46c95_icgraph.png" border="0" usemap="#cube_8c_ae749e989b362e19783c7af4a2bf46c95_icgraph" alt=""/></div>
<map name="cube_8c_ae749e989b362e19783c7af4a2bf46c95_icgraph" id="cube_8c_ae749e989b362e19783c7af4a2bf46c95_icgraph">
<area shape="rect" id="node2" href="cube_8c.html#a3553c2367998ea3c060aa8f3d64ed155" title="demo_create_window" alt="" coords="129,5,276,32"/>
<area shape="rect" id="node3" href="cube_8c.html#aaeec9c5b7aa4be5544a74d2030e12a3a" title="WinMain" alt="" coords="324,5,397,32"/>
</map>
</div>
</p>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="a11282d06da34a669ccca5b1a9336c225"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structdemo.html">demo</a> <a class="el" href="structdemo.html">demo</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l02341">2341</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l02849">demo_init_vk()</a>.</p>

</div>
</div>
<a class="anchor" id="ae47449d2c6ee5d67200b1d7e8ecec805"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">PFN_vkGetDeviceProcAddr g_gdpa = NULL</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00146">146</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

</div>
</div>
<a class="anchor" id="ac130934c0214edabeb9870bcd94eca8c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const float g_uv_buffer_data[]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00231">231</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l01680">demo_prepare_cube_data_buffers()</a>.</p>

</div>
</div>
<a class="anchor" id="adee35d5feec2cc176806a5fa7f468648"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const float g_vertex_buffer_data[]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00187">187</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l01680">demo_prepare_cube_data_buffers()</a>.</p>

</div>
</div>
<a class="anchor" id="a302091c8be81415de8beb0d5b5e18529"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">char* tex_files[] = {&quot;lunarg.ppm&quot;}</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00172">172</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l01574">demo_prepare_textures()</a>.</p>

</div>
</div>
<a class="anchor" id="aa2a7e938c1d845c6a71f43750db0fd07"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int validation_error = 0</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="cube_8c_source.html#l00174">174</a> of file <a class="el" href="cube_8c_source.html">cube.c</a>.</p>

<p>Referenced by <a class="el" href="cube_8c_source.html#l00453">debug_messenger_callback()</a>, <a class="el" href="cube_8c_source.html#l02344">demo_run()</a>, <a class="el" href="cube_8c_source.html#l03702">WinMain()</a>, and <a class="el" href="cube_8c_source.html#l02355">WndProc()</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
